RegisteredEnum

Trait RegisteredEnum 

Source
pub trait RegisteredEnum {
    const CASES: &'static [EnumCase];

    // Required methods
    fn from_name(name: &str) -> Result<Self>
       where Self: Sized;
    fn to_name(&self) -> &'static str;
}
Available on crate feature enum only.
Expand description

Implemented on Rust enums which are exported to PHP.

Required Associated Constants§

Source

const CASES: &'static [EnumCase]

The cases of the enum.

Required Methods§

Source

fn from_name(name: &str) -> Result<Self>
where Self: Sized,

§Errors
Source

fn to_name(&self) -> &'static str

Returns the variant name of the enum as it is registered in PHP.

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§