#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum InsertError
{
AlreadyPresent,
MaximumCapacityReached,
OutOfMemory,
}
impl Display for InsertError
{
#[inline(always)]
fn fmt(&self, f: &mut Formatter) -> fmt::Result
{
Debug::fmt(self, f)
}
}
impl error::Error for InsertError
{
#[inline(always)]
fn source(&self) -> Option<&(dyn error::Error + 'static)>
{
use self::InsertError::*;
match self
{
&AlreadyPresent => None,
&MaximumCapacityReached => None,
&OutOfMemory => None,
}
}
}