[][src]Trait int_enum::IntEnum

pub trait IntEnum: Sized + Debug {
    type Int: PrimInt;
    fn to_int(&self) -> Self::Int;
fn from_int(n: Self::Int) -> Result<Self, IntEnumError<Self>>; }

Trait used for implementations of integer and enum conversions.

Associated Types

type Int: PrimInt

Primitive integer type for conversions.

Loading content...

Required methods

fn to_int(&self) -> Self::Int

Returns the integer value of the enum.

fn from_int(n: Self::Int) -> Result<Self, IntEnumError<Self>>

Converts an integer into the enum.

Loading content...

Implementors

Loading content...