struct Container<'a> {
path: Path,
ty: ContainerType<'a>,
err_name: String,
rename_rule: Option<RenamingRule>,
}Expand description
Data container
Either describes a struct or an enum variant.
Fields§
§path: Path§ty: ContainerType<'a>§err_name: String§rename_rule: Option<RenamingRule>Implementations§
Source§impl<'a> Container<'a>
impl<'a> Container<'a>
Sourcefn new(
fields: &'a Fields,
path: Path,
options: ContainerAttributes,
) -> Result<Self>
fn new( fields: &'a Fields, path: Path, options: ContainerAttributes, ) -> 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
fn build(&self, ctx: &Ctx) -> TokenStream
Build derivation body for a struct.
fn build_newtype_struct( &self, field_ident: Option<&Ident>, from_py_with: &Option<KeywordAttribute<from_py_with, ExprPath>>, ctx: &Ctx, ) -> TokenStream
fn build_tuple_struct( &self, struct_fields: &[TupleStructField], ctx: &Ctx, ) -> TokenStream
fn build_struct( &self, struct_fields: &[NamedStructField<'_>], ctx: &Ctx, ) -> 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> UnsafeUnpin 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
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