Trait IntoVariant

Source
pub trait IntoVariant<T>: Sized {
    // Required method
    fn into_variant(self) -> Result<T, Self>;
}
Expand description

Returns the current variant’s field, consuming self.

Required Methods§

Source

fn into_variant(self) -> Result<T, Self>

Returns the inner value if it is of type T, or Err(self) if it isn’t.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§