pub struct BopEnumVariant { /* private fields */ }Expand description
A user-defined enum variant value — the concrete data side of
Bop’s sum types. Like BopStruct, it’s identified by the
(module_path, type_name) pair, plus the selected variant’s
name and payload. Two enums declared in different modules with
the same type name and even the same variants still compare
as distinct types.
Implementations§
Source§impl BopEnumVariant
impl BopEnumVariant
pub fn type_name(&self) -> &str
Sourcepub fn module_path(&self) -> &str
pub fn module_path(&self) -> &str
Module this enum type was declared in. Paired with
Self::type_name to form the type’s identity.
pub fn variant(&self) -> &str
pub fn payload(&self) -> &EnumPayload
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BopEnumVariant
impl !RefUnwindSafe for BopEnumVariant
impl !Send for BopEnumVariant
impl !Sync for BopEnumVariant
impl Unpin for BopEnumVariant
impl UnsafeUnpin for BopEnumVariant
impl !UnwindSafe for BopEnumVariant
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