-
Notifications
You must be signed in to change notification settings - Fork 94
introduce BilrostAs derive macro #3208
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
0f7ce1d
to
2117901
Compare
@AhmedSoliman I recommend that you look at the tests here https://github.com/restatedev/restate/pull/3208/files#diff-84254cab3a4d09daad7bfb0f2f851bec0b3151449b5a620fb49df41878ed216f first to see how the macro is used |
|
||
Err(syn::Error::new( | ||
input.span(), | ||
"Missing bilrost_as attribute", |
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.
Worth including usage example to help the user.
1566839
to
739bcf0
Compare
The |
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.
Superb!
@@ -90,6 +94,9 @@ where | |||
} | |||
|
|||
impl<V> NetSerde for HashSet<V> where V: NetSerde {} | |||
impl<Idx> NetSerde for RangeInclusive<Idx> where Idx: NetSerde {} | |||
impl<T> NetSerde for Arc<T> where T: NetSerde {} | |||
impl<T> NetSerde for Arc<[T]> where T: NetSerde {} |
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.
nit: can we also have Box<[T]>
?
Summary: The macro can be deriven on anytime given that the target type can be created From<&T>. There is also an implementation for an adaptor that can use the `Display` and `FromStr` to serialize and deserialize the type. ## Notice: Right now the BilrostAs macro requires that the annotated type must implement `Default`. This is needed since Bilrost requires that it can create an `empty state` of that field.
introduce BilrostAs derive macro
Summary:
The macro can be deriven on anytime given that the target type
can be created From<&T>.
There is also an implementation for an adaptor that can use the
Display
andFromStr
to serialize and deserialize the type.Notice:
Right now the BilrostAs macro requires that the annotated type must
implement
Default
. This is needed since Bilrost requires that itcan create an
empty state
of that field.Stack created with Sapling. Best reviewed with ReviewStack.