pub struct EnumForm<'t> {
pub shape: &'t Arc<EnumShape>,
/* private fields */
}Expand description
An enum type: its shape, and each constructor’s payload types.
Fields§
§shape: &'t Arc<EnumShape>The shape its values are built with, which names the constructors and their payloads.
Implementations§
Source§impl<'t> EnumForm<'t>
impl<'t> EnumForm<'t>
Sourcepub fn parts(&self, ctor: usize) -> Option<Vec<Cow<'t, Type>>>
pub fn parts(&self, ctor: usize) -> Option<Vec<Cow<'t, Type>>>
The payload types of the constructor numbered ctor, counted from 0
in declaration order, with the enum’s arguments in place; None for
a number the enum has no constructor for. A part the enum’s type
holds as it is, such as an Option’s item, is borrowed from it.
Trait Implementations§
Auto Trait Implementations§
impl<'t> Forget for EnumForm<'t>
impl<'t> Freeze for EnumForm<'t>
impl<'t> Move for EnumForm<'t>
impl<'t> RefUnwindSafe for EnumForm<'t>
impl<'t> Send for EnumForm<'t>
impl<'t> Sync for EnumForm<'t>
impl<'t> Unpin for EnumForm<'t>
impl<'t> UnsafeUnpin for EnumForm<'t>where
&'t Arc<EnumShape>: UnsafeUnpin,
&'t [Vec<Type>]: UnsafeUnpin,
&'t [Type]: UnsafeUnpin,
&'t Type: UnsafeUnpin,
&'t StdEnum<JsonValueCtor>: UnsafeUnpin,
impl<'t> UnwindSafe for EnumForm<'t>where
&'t Arc<EnumShape>: UnwindSafe,
&'t [Vec<Type>]: UnwindSafe,
&'t [Type]: UnwindSafe,
&'t Type: UnwindSafe,
&'t StdEnum<JsonValueCtor>: UnwindSafe,
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