Struct pyo3_macros_backend::frompyobject::Container
source · [−]struct Container<'a> {
path: Path,
ty: ContainerType<'a>,
err_name: String,
is_enum_variant: bool,
}
Expand description
Data container
Either describes a struct or an enum variant.
Fields
path: Path
ty: ContainerType<'a>
err_name: String
is_enum_variant: bool
Implementations
sourceimpl<'a> Container<'a>
impl<'a> Container<'a>
sourcefn new(
fields: &'a Fields,
path: Path,
options: ContainerOptions,
is_enum_variant: bool
) -> Result<Self>
fn new(
fields: &'a Fields,
path: Path,
options: ContainerOptions,
is_enum_variant: bool
) -> Result<Self>
Construct a container based on fields, identifier and attributes.
Fails if the variant has no fields or incompatible attributes.
sourcefn build(&self) -> TokenStream
fn build(&self) -> TokenStream
Build derivation body for a struct.
fn build_newtype_struct(&self, field_ident: Option<&Ident>) -> TokenStream
fn build_tuple_struct(&self, len: usize) -> TokenStream
fn build_struct(&self, tups: &[(&Ident, FieldPyO3Attributes)]) -> TokenStream
Trait Implementations
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more