#[repr(u8)]
pub enum Discriminant
{
Inlined,
Allocated,
Borrowed
}
impl Discriminant
{
#[inline(always)]
pub fn from_owned(inlined: bool) -> Self
{
if inlined { Self::Inlined }
else { Self::Allocated }
}
#[inline(always)]
pub fn
from_info((inlined, owned): (bool, bool)) -> Self
{
match (inlined, owned)
{
(_, false) => Self::Borrowed,
(true, true) => Self::Inlined,
(false, true) => Self::Allocated
}
}
}