Skip to main content

EnumRef

Trait EnumRef 

Source
pub trait EnumRef {
    type Ref<'a>
       where Self: 'a;

    // Required method
    fn as_ref(&self) -> Self::Ref<'_>;
}
Expand description

Trait implemented by enum types for shared access.

This trait usually is implemented via #[derive(EnumRef)].

Required Associated Types§

Source

type Ref<'a> where Self: 'a

A wrapper type around Self for shared access.

Required Methods§

Source

fn as_ref(&self) -> Self::Ref<'_>

Returns a shared reference wrapper to self.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§