Struct wasm_component_layer::EnumType
source · pub struct EnumType { /* private fields */ }
Expand description
A type that has multiple possible states.
Implementations§
source§impl EnumType
impl EnumType
sourcepub fn new<S: Into<Arc<str>>>(
name: Option<TypeIdentifier>,
cases: impl IntoIterator<Item = S>
) -> Result<Self>
pub fn new<S: Into<Arc<str>>>( name: Option<TypeIdentifier>, cases: impl IntoIterator<Item = S> ) -> Result<Self>
Creates a new enumeration from the list of case names. The case names must be unique.
sourcepub fn name(&self) -> Option<&TypeIdentifier>
pub fn name(&self) -> Option<&TypeIdentifier>
Gets the name of this type, if any.
sourcepub fn cases(&self) -> impl ExactSizeIterator<Item = &str>
pub fn cases(&self) -> impl ExactSizeIterator<Item = &str>
Gets a list of all cases in this enum.
Trait Implementations§
source§impl PartialEq<EnumType> for EnumType
impl PartialEq<EnumType> for EnumType
impl Eq for EnumType
Auto Trait Implementations§
impl RefUnwindSafe for EnumType
impl Send for EnumType
impl Sync for EnumType
impl Unpin for EnumType
impl UnwindSafe for EnumType
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.