-
Notifications
You must be signed in to change notification settings - Fork 276
Add catalog builder trait #1261
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
Conversation
I tried to use object safety trait, but found a lot limitation which will make the code difficult to use, so I rollback to this version. For a more complete example, see #1231 |
I have a new proposal in #1254 |
/// The catalog type that this builder creates. | ||
type C: Catalog; | ||
/// Create a new catalog instance. | ||
fn load( |
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.
How about simply using async fn
? It's not a big thing for us to place with Send
I guess.
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.
We still need Send
, otherwise this line can't be compiled.
/// Create a new catalog instance. | ||
fn load( | ||
self, | ||
name: impl Into<String>, |
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.
Since name
won't be a bottleneck, how about just using &str
?
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.
I still perfer to use this generic given we don't need to worry about object safety things 😄
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.
No concerns, this seems good to me
Which issue does this PR close?
CatalogBuilder
trait. #1254 .What changes are included in this PR?
Add
CatalogBuilder
trait.Are these changes tested?
No, empty trait def.