Struct pyo3_macros_backend::frompyobject::Container
source · struct Container<'a> {
path: Path,
ty: ContainerType<'a>,
err_name: String,
}
Expand description
Data container
Either describes a struct or an enum variant.
Fields§
§path: Path
§ty: ContainerType<'a>
§err_name: String
Implementations§
source§impl<'a> Container<'a>
impl<'a> Container<'a>
sourcefn new(
fields: &'a Fields,
path: Path,
options: ContainerOptions
) -> Result<Self>
fn new( fields: &'a Fields, path: Path, options: ContainerOptions ) -> Result<Self>
Construct a container based on fields, identifier and attributes.
Fails if the variant has no fields or incompatible attributes.
fn name(&self) -> String
sourcefn build(&self, ctx: &Ctx) -> (TokenStream, TokenStream)
fn build(&self, ctx: &Ctx) -> (TokenStream, TokenStream)
Build derivation body for a struct.
fn build_newtype_struct( &self, field_ident: Option<&Ident>, from_py_with: &Option<KeywordAttribute<from_py_with, LitStrValue<ExprPath>>>, ctx: &Ctx ) -> (TokenStream, TokenStream)
fn build_tuple_struct( &self, struct_fields: &[TupleStructField], ctx: &Ctx ) -> (TokenStream, TokenStream)
fn build_struct( &self, struct_fields: &[NamedStructField<'_>], ctx: &Ctx ) -> (TokenStream, TokenStream)
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