Skip to main content

EnumForm

Struct EnumForm 

Source
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>

Source

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§

Source§

impl<'t> Clone for EnumForm<'t>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'t> Debug for EnumForm<'t>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'t> Forget for EnumForm<'t>

§

impl<'t> Freeze for EnumForm<'t>
where &'t Arc<EnumShape>: Freeze, &'t [Vec<Type>]: Freeze, &'t [Type]: Freeze, &'t Type: Freeze, &'t StdEnum<JsonValueCtor>: Freeze,

§

impl<'t> Move for EnumForm<'t>

§

impl<'t> RefUnwindSafe for EnumForm<'t>

§

impl<'t> Send for EnumForm<'t>
where &'t Arc<EnumShape>: Send, &'t [Vec<Type>]: Send, &'t [Type]: Send, &'t Type: Send, &'t StdEnum<JsonValueCtor>: Send,

§

impl<'t> Sync for EnumForm<'t>
where Arc<EnumShape>: Sync, RawVecInner: Sync, BoxRaw<Type>: Sync, BoxRaw<[usize]>: Sync, BoxRaw<[Option<JsonValueCtor>]>: Sync,

§

impl<'t> Unpin for EnumForm<'t>
where &'t Arc<EnumShape>: Unpin, &'t [Vec<Type>]: Unpin, &'t [Type]: Unpin, &'t Type: Unpin, &'t StdEnum<JsonValueCtor>: Unpin,

§

impl<'t> UnsafeUnpin for EnumForm<'t>

§

impl<'t> UnwindSafe for EnumForm<'t>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.