pub struct Variant { /* private fields */ }Expand description
An enum value.
Implementations§
Source§impl Variant
impl Variant
Sourcepub fn new(
shape: Arc<EnumShape>,
index: usize,
payload: Vec<Value>,
) -> Option<Self>
pub fn new( shape: Arc<EnumShape>, index: usize, payload: Vec<Value>, ) -> Option<Self>
Returns the value of the constructor at a declaration index carrying
payload, or None when there is no such constructor or the payload
does not hold exactly as many values as it declares.
Sourcepub fn constructor(&self) -> &Constructor
pub fn constructor(&self) -> &Constructor
Returns the constructor.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Variant
impl !UnwindSafe for Variant
impl Freeze for Variant
impl Send for Variant
impl Sync for Variant
impl Unpin for Variant
impl UnsafeUnpin for Variant
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