-
Notifications
You must be signed in to change notification settings - Fork 238
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
Make From<UnexpectedUniFFICallbackError> optional #1790
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,14 +216,33 @@ pub(crate) fn tagged_impl_header( | |
} | ||
} | ||
|
||
pub(crate) fn derive_ffi_traits(ty: &Ident, udl_mode: bool) -> TokenStream { | ||
pub(crate) fn derive_all_ffi_traits(ty: &Ident, udl_mode: bool) -> TokenStream { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These names kinda bother me a little - There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They both take a single type identifier, but There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh right, doh! Swapping those 2 args sounds great, thanks! |
||
if udl_mode { | ||
quote! { ::uniffi::derive_ffi_traits!(local #ty); } | ||
} else { | ||
quote! { ::uniffi::derive_ffi_traits!(blanket #ty); } | ||
} | ||
} | ||
|
||
pub(crate) fn derive_ffi_traits(ty: &Ident, udl_mode: bool, trait_names: &[&str]) -> TokenStream { | ||
let trait_idents = trait_names | ||
.iter() | ||
.map(|name| Ident::new(name, Span::call_site())); | ||
if udl_mode { | ||
quote! { | ||
#( | ||
::uniffi::derive_ffi_traits!(impl #trait_idents<crate::UniFfiTag> for #ty); | ||
)* | ||
} | ||
} else { | ||
quote! { | ||
#( | ||
::uniffi::derive_ffi_traits!(impl<UT> #trait_idents<UT> for #ty); | ||
)* | ||
} | ||
} | ||
} | ||
|
||
/// Custom keywords | ||
pub mod kw { | ||
syn::custom_keyword!(async_runtime); | ||
|
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.
far out, that's crazy :) Thanks for the link!