pub enum Error {
WindowLargerThanMap(Vector2<usize>, Vector2<usize>),
PositionOutsideMap(String, Point2<f64>),
IndexOutsideMap(Point2<usize>),
WrongNumberOfLayers(usize, usize),
LayerWrongShape((usize, usize), (usize, usize)),
IoError(Error),
JsonError(Error),
InvalidBounds(Bounds),
}
Expand description
Standard error type for errors related to CellMap
s.
Variants§
WindowLargerThanMap(Vector2<usize>, Vector2<usize>)
Error returned when trying to construct a Windows
slicer using a semi_width
which
would create a window larger than the size of the map.
PositionOutsideMap(String, Point2<f64>)
The given parent-frame position (name, first element) is outside the map.
IndexOutsideMap(Point2<usize>)
The given index is outside the map.
WrongNumberOfLayers(usize, usize)
Wrong number of layers, got (first) but expected (second)
LayerWrongShape((usize, usize), (usize, usize))
Wrong shape of layer, got (first) but expected (second)
IoError(Error)
Errors associated with std::io
operations.
JsonError(Error)
Errors associated with serde_json
operations.
InvalidBounds(Bounds)
Error when bounds are invalid, i.e. the minimum is larger than the maximum
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.