pub struct EnumTypeFragment { /* private fields */ }Expand description
Named enum-type definition.
Implementations§
Source§impl EnumTypeFragment
impl EnumTypeFragment
Sourcepub fn try_new(
name: SchemaName,
variants: Vec<EnumVariantFragment>,
) -> Result<EnumTypeFragment, SchemaContractError>
pub fn try_new( name: SchemaName, variants: Vec<EnumVariantFragment>, ) -> Result<EnumTypeFragment, SchemaContractError>
Construct and canonicalize an enum definition.
§Errors
Returns a typed contract error for empty, oversized, or duplicate variants.
Sourcepub const fn source_key(&self) -> &TypeSourceKey
pub const fn source_key(&self) -> &TypeSourceKey
Borrow the typed proposal key derived from the current enum name.
Sourcepub const fn name(&self) -> &SchemaName
pub const fn name(&self) -> &SchemaName
Borrow the current enum name.
Sourcepub fn variants(&self) -> &[EnumVariantFragment]
pub fn variants(&self) -> &[EnumVariantFragment]
Borrow canonical enum variants.
Trait Implementations§
Source§impl CandidType for EnumTypeFragment
impl CandidType for EnumTypeFragment
Source§impl Clone for EnumTypeFragment
impl Clone for EnumTypeFragment
Source§fn clone(&self) -> EnumTypeFragment
fn clone(&self) -> EnumTypeFragment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EnumTypeFragment
impl Debug for EnumTypeFragment
Source§impl<'de> Deserialize<'de> for EnumTypeFragment
impl<'de> Deserialize<'de> for EnumTypeFragment
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EnumTypeFragment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EnumTypeFragment, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for EnumTypeFragment
Source§impl PartialEq for EnumTypeFragment
impl PartialEq for EnumTypeFragment
Source§impl Serialize for EnumTypeFragment
impl Serialize for EnumTypeFragment
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for EnumTypeFragment
Auto Trait Implementations§
impl Freeze for EnumTypeFragment
impl RefUnwindSafe for EnumTypeFragment
impl Send for EnumTypeFragment
impl Sync for EnumTypeFragment
impl Unpin for EnumTypeFragment
impl UnsafeUnpin for EnumTypeFragment
impl UnwindSafe for EnumTypeFragment
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.