struct Container<'a> {
path: Path,
receiver: Option<Ident>,
ty: ContainerType<'a>,
}
Expand description
Data container
Either describes a struct or an enum variant.
Fields§
§path: Path
§receiver: Option<Ident>
§ty: ContainerType<'a>
Implementations§
Source§impl<'a> Container<'a>
impl<'a> Container<'a>
Construct a container based on fields, identifier and attributes.
Sourcefn new(
receiver: Option<Ident>,
fields: &'a Fields,
path: Path,
options: ContainerOptions,
) -> Result<Self>
fn new( receiver: Option<Ident>, fields: &'a Fields, path: Path, options: ContainerOptions, ) -> Result<Self>
Fails if the variant has no fields or incompatible attributes.
fn match_pattern(&self) -> TokenStream
Sourcefn build(&self, ctx: &Ctx) -> IntoPyObjectImpl
fn build(&self, ctx: &Ctx) -> IntoPyObjectImpl
Build derivation body for a struct.
fn build_newtype_struct(&self, field: &Field, ctx: &Ctx) -> IntoPyObjectImpl
fn build_struct( &self, fields: &[NamedStructField<'_>], ctx: &Ctx, ) -> IntoPyObjectImpl
fn build_tuple_struct( &self, fields: &[TupleStructField<'_>], ctx: &Ctx, ) -> IntoPyObjectImpl
Auto Trait Implementations§
impl<'a> Freeze for Container<'a>
impl<'a> RefUnwindSafe for Container<'a>
impl<'a> !Send for Container<'a>
impl<'a> !Sync for Container<'a>
impl<'a> Unpin for Container<'a>
impl<'a> UnwindSafe for Container<'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