pub enum MySumType {
First(u32),
Second(&'static str),
Third(&'static [u8]),
}
Variants§
First(u32)
The first variant.
Second(&'static str)
The second variant.
Third(&'static [u8])
A list of bytes.
Trait Implementations§
Source§impl SumType for MySumType
impl SumType for MySumType
Source§fn downcast_ref<T: Any>(&self) -> Option<&T>
fn downcast_ref<T: Any>(&self) -> Option<&T>
Try to get a reference to the inner field if it is a
T
.Source§fn downcast_mut<T: Any>(&mut self) -> Option<&mut T>
fn downcast_mut<T: Any>(&mut self) -> Option<&mut T>
Return a mutable reference to the inner field if it is a
T
.Source§fn variant_is<T: Any>(&self) -> bool
fn variant_is<T: Any>(&self) -> bool
Is the underlying variant an instance of
T
?impl Copy for MySumType
impl StructuralPartialEq for MySumType
Auto Trait Implementations§
impl Freeze for MySumType
impl RefUnwindSafe for MySumType
impl Send for MySumType
impl Sync for MySumType
impl Unpin for MySumType
impl UnwindSafe for MySumType
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