struct Container<'a, const REF: bool> {
path: Path,
receiver: Option<Ident>,
ty: ContainerType<'a>,
rename_rule: Option<RenamingRule>,
}Expand description
Data container
Either describes a struct or an enum variant.
Fields§
§path: Path§receiver: Option<Ident>§ty: ContainerType<'a>§rename_rule: Option<RenamingRule>Implementations§
Source§impl<'a, const REF: bool> Container<'a, REF>
Construct a container based on fields, identifier and attributes.
impl<'a, const REF: bool> Container<'a, REF>
Construct a container based on fields, identifier and attributes.
Sourcefn new(
receiver: Option<Ident>,
fields: &'a Fields,
path: Path,
options: ContainerAttributes,
) -> Result<Self>
fn new( receiver: Option<Ident>, fields: &'a Fields, path: Path, options: ContainerAttributes, ) -> 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, const REF: bool> Freeze for Container<'a, REF>
impl<'a, const REF: bool> RefUnwindSafe for Container<'a, REF>
impl<'a, const REF: bool> !Send for Container<'a, REF>
impl<'a, const REF: bool> !Sync for Container<'a, REF>
impl<'a, const REF: bool> Unpin for Container<'a, REF>
impl<'a, const REF: bool> UnsafeUnpin for Container<'a, REF>
impl<'a, const REF: bool> UnwindSafe for Container<'a, REF>
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
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
🔬This is a nightly-only experimental API. (
ptr_alignment_type)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)The largest safe length for a
[Self]. Read more