#![doc = include_str!("README.md")]
#[doc(hidden)]
pub use addr_of_enum;
use core::mem::Discriminant;
pub use fast_enum_conversion_macro::convert_to;
#[doc(hidden)]
pub mod _tstr {
macro_rules! chars {
() => {};
($id:ident $($rem:tt)*) => {
#[allow(non_camel_case_types)]
pub struct $id(::core::convert::Infallible);
chars!($($rem)*);
};
}
chars! {
_A _B _C _D _E _F _G _H _I _J _K _L _M _N _O _P _Q _R _S _T _U
_V _W _X _Y _Z
_a _b _c _d _e _f _g _h _i _j _k _l _m _n _o _p _q _r _s _t _u
_v _w _x _y _z
_0 _1 _2 _3 _4 _5 _6 _7 _8 _9
__
}
}
#[doc(hidden)]
pub unsafe trait HasVariant<TSName>: Sized {
type Fields: Sized;
type Offsets;
fn discriminant() -> Discriminant<Self>;
fn offsets() -> Self::Offsets;
}
pub trait ConvertTo<Target>: Sized {
fn convert_to(self) -> Target;
#[doc(hidden)]
fn convert_to_slow(self) -> Target;
fn try_convert_from(_: Target) -> Result<Self, Target>;
#[doc(hidden)]
fn try_convert_from_slow(_: Target) -> Result<Self, Target>;
fn is_zerocost() -> bool;
}