pub struct Fields<T: FromFields = Fields>(/* private fields */);Expand description
Element extractor that pulls struct fields from the input.
Defaults to syn::Fields (accepts any field kind). Parameterize with
syn::FieldsNamed or syn::FieldsUnnamed to restrict and validate.
Access the inner value via Deref or the inner() method.
ⓘ
#[zyn::element]
fn my_element(#[zyn(input)] fields: zyn::Fields<syn::FieldsNamed>) -> proc_macro2::TokenStream {
// fields.named — accessed via Deref to syn::FieldsNamed
}Implementations§
Trait Implementations§
Source§impl<T: FromFields> Deref for Fields<T>
impl<T: FromFields> Deref for Fields<T>
Source§impl<T: FromFields> DerefMut for Fields<T>
impl<T: FromFields> DerefMut for Fields<T>
Source§impl<T: FromFields> FromInput for Fields<T>
impl<T: FromFields> FromInput for Fields<T>
fn from_input(input: &Input) -> Result<Self>
Auto Trait Implementations§
impl<T> Freeze for Fields<T>where
T: Freeze,
impl<T> RefUnwindSafe for Fields<T>where
T: RefUnwindSafe,
impl<T> Send for Fields<T>where
T: Send,
impl<T> Sync for Fields<T>where
T: Sync,
impl<T> Unpin for Fields<T>where
T: Unpin,
impl<T> UnsafeUnpin for Fields<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Fields<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more