pub enum ConstructableStructure<'a> {
Struct(&'a mut StructStructure),
EnumVariant(&'a mut EnumVariant, &'a [Attribute]),
}
Expand description
Either a StructStructure or EnumVariant (with it’s parents attributes)
Variants§
Struct(&'a mut StructStructure)
EnumVariant(&'a mut EnumVariant, &'a [Attribute])
Implementations§
source§impl<'a> ConstructableStructure<'a>
impl<'a> ConstructableStructure<'a>
pub fn as_enum_variant(&'a self) -> Option<&'a EnumVariant>
pub fn all_attributes<'b: 'a>( &'b self ) -> impl Iterator<Item = &'b Attribute> + '_
Trait Implementations§
source§impl Constructable for ConstructableStructure<'_>
impl Constructable for ConstructableStructure<'_>
source§fn build_constructor(
&self,
generator: impl Fn(NamedOrUnnamedField<'_>) -> Result<Expr, Box<dyn Error>>
) -> Result<Expr, Box<dyn Error>>
fn build_constructor( &self, generator: impl Fn(NamedOrUnnamedField<'_>) -> Result<Expr, Box<dyn Error>> ) -> Result<Expr, Box<dyn Error>>
Builds a constructor expression by evaluating a expression generator for each field
fn get_fields(&self) -> &Fields
fn get_fields_mut(&mut self) -> &mut Fields
source§fn get_constructor_path(&self) -> Path
fn get_constructor_path(&self) -> Path
Get the path required to construct the expression
Auto Trait Implementations§
impl<'a> RefUnwindSafe for ConstructableStructure<'a>
impl<'a> !Send for ConstructableStructure<'a>
impl<'a> !Sync for ConstructableStructure<'a>
impl<'a> Unpin for ConstructableStructure<'a>
impl<'a> !UnwindSafe for ConstructableStructure<'a>
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