-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat(embeddings): Embeddable derive macro #59
Feat(embeddings): Embeddable derive macro #59
Conversation
…at(embeddings)/derive-macro
@garance-buricatu can you split the PR into two: 1) a PR that removes That would make it much easier to review. Thank you! |
pub fn rest(&self) -> Vec<T> { | ||
self.rest.clone() | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I created the methods one
and many
to create objects of type OneOrMany
instead of doing
impl From<T> for OneOrMany<T>
and impl From<Vec<T>> for OneOrMany<T>
because these are conflicting. See my comment below for why I would use impl From<Vec<T>> for OneOrMany<T>
instead of impl TryFrom<Vec<T>> for OneOrMany<T>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not done reviewing, but there's a lot of stuff to change so here is the first part
devops: Add cargo check for all features + doc check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Just a tiny change to the OneOrMany error definition and then you can merge :)
TODO: RENAME
Embeddable
trait toToEmbedabble
,ToEmbedTargets
,Extract
,ExtractEmbeddable
, ...This PR accomplishes:
Embeddable
trait which selects the portions of a struct that need ot be embedded. Theembeddable()
method returns aOneOrMany
object which returns either one or many items to embed.Embeddable
trait for any user-defined object