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§
impl Eq for EnumType
Auto Trait Implementations§
impl Freeze for EnumType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.