pub enum FieldList {
Named(Vec<NamedField>),
Unnamed(Vec<UnnamedField>),
Unit,
}Expand description
The field list of a structure.
Variants§
Named(Vec<NamedField>)
A named field list, which is a list of fields that are named.
Unnamed(Vec<UnnamedField>)
An unnamed field list, which is a list of fields that are not named.
Unit
A unit field list, which is equivalent to an absence of fields.
Implementations§
Source§impl FieldList
impl FieldList
Sourcepub fn exactly_one(fields: &Fields) -> Result<(FieldRef, Type)>
pub fn exactly_one(fields: &Fields) -> Result<(FieldRef, Type)>
Expect exactly one field in the target syn::Fields.
Sourcepub fn pattern(&self) -> Result<TokenStream>
pub fn pattern(&self) -> Result<TokenStream>
Compute an irrefutable pattern for this field list.
Trait Implementations§
impl Eq for FieldList
impl StructuralPartialEq for FieldList
Auto Trait Implementations§
impl Freeze for FieldList
impl RefUnwindSafe for FieldList
impl !Send for FieldList
impl !Sync for FieldList
impl Unpin for FieldList
impl UnwindSafe for FieldList
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