Struct ink_metadata::layout::EnumLayout
source · [−]Expand description
An enum storage layout.
Implementations
sourceimpl EnumLayout
impl EnumLayout
sourcepub fn new<K, V>(dispatch_key: K, variants: V) -> Self where
K: Into<LayoutKey>,
V: IntoIterator<Item = (Discriminant, StructLayout)>,
pub fn new<K, V>(dispatch_key: K, variants: V) -> Self where
K: Into<LayoutKey>,
V: IntoIterator<Item = (Discriminant, StructLayout)>,
Creates a new enum layout.
sourceimpl<F> EnumLayout<F> where
F: Form,
impl<F> EnumLayout<F> where
F: Form,
sourcepub fn dispatch_key(&self) -> &LayoutKey
pub fn dispatch_key(&self) -> &LayoutKey
Returns the key where the discriminant is stored to dispatch the variants.
sourcepub fn variants(&self) -> &BTreeMap<Discriminant, StructLayout<F>>
pub fn variants(&self) -> &BTreeMap<Discriminant, StructLayout<F>>
Returns the variants of the enum.
Trait Implementations
sourceimpl<F: Debug + Form> Debug for EnumLayout<F>
impl<F: Debug + Form> Debug for EnumLayout<F>
sourceimpl<'de, F: Form> Deserialize<'de> for EnumLayout<F> where
F::Type: DeserializeOwned,
F::String: DeserializeOwned,
impl<'de, F: Form> Deserialize<'de> for EnumLayout<F> where
F::Type: DeserializeOwned,
F::String: DeserializeOwned,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<F: Form> From<EnumLayout<F>> for Layout<F>
impl<F: Form> From<EnumLayout<F>> for Layout<F>
sourcefn from(original: EnumLayout<F>) -> Layout<F>
fn from(original: EnumLayout<F>) -> Layout<F>
Converts to this type from the input type.
sourceimpl IntoPortable for EnumLayout
impl IntoPortable for EnumLayout
type Output = EnumLayout<PortableForm>
type Output = EnumLayout<PortableForm>
The portable version of Self
.
sourcefn into_portable(self, registry: &mut Registry) -> Self::Output
fn into_portable(self, registry: &mut Registry) -> Self::Output
Convert self
to the portable form by using the registry for caching.
sourceimpl<F: Ord + Form> Ord for EnumLayout<F>
impl<F: Ord + Form> Ord for EnumLayout<F>
sourceimpl<F: PartialEq + Form> PartialEq<EnumLayout<F>> for EnumLayout<F>
impl<F: PartialEq + Form> PartialEq<EnumLayout<F>> for EnumLayout<F>
sourcefn eq(&self, other: &EnumLayout<F>) -> bool
fn eq(&self, other: &EnumLayout<F>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &EnumLayout<F>) -> bool
fn ne(&self, other: &EnumLayout<F>) -> bool
This method tests for !=
.
sourceimpl<F: PartialOrd + Form> PartialOrd<EnumLayout<F>> for EnumLayout<F>
impl<F: PartialOrd + Form> PartialOrd<EnumLayout<F>> for EnumLayout<F>
sourcefn partial_cmp(&self, other: &EnumLayout<F>) -> Option<Ordering>
fn partial_cmp(&self, other: &EnumLayout<F>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<F: Eq + Form> Eq for EnumLayout<F>
impl<F: Form> StructuralEq for EnumLayout<F>
impl<F: Form> StructuralPartialEq for EnumLayout<F>
Auto Trait Implementations
impl<F> RefUnwindSafe for EnumLayout<F> where
<F as Form>::String: RefUnwindSafe,
<F as Form>::Type: RefUnwindSafe,
impl<F> Send for EnumLayout<F> where
<F as Form>::String: Send,
<F as Form>::Type: Send,
impl<F> Sync for EnumLayout<F> where
<F as Form>::String: Sync,
<F as Form>::Type: Sync,
impl<F> Unpin for EnumLayout<F>
impl<F> UnwindSafe for EnumLayout<F> where
<F as Form>::String: RefUnwindSafe,
<F as Form>::Type: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more