use crate::parts::*;
use core::any;
use core::ops::Bound;
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum BoundsUnfit {
NewRange(NewRangeErr),
NewBroken(NewBrokenErr),
}
impl BoundsUnfit {
pub fn new<R, T>(bounds: &(Bound<T>, Bound<T>)) -> Self {
Self::NewRange(NewRangeErr {
to_type: any::type_name::<R>(),
from_sb: bound(bounds.0.as_ref()).kind(),
from_eb: bound(bounds.1.as_ref()).kind(),
})
}
pub fn new_broken<R>() -> Self {
Self::NewBroken(NewBrokenErr {
to_type: any::type_name::<R>(),
})
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct NewRangeErr {
to_type: &'static str,
from_sb: Option<bool>,
from_eb: Option<bool>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct NewBrokenErr {
to_type: &'static str,
}