pub enum PathError {
PathTooLong,
TooManyComponents,
ComponentTooLong,
}Expand description
An error arising from trying to construct an invalid Path.
§Examples
use willow_data_model::prelude::*;
assert_eq!(Path::<4, 4, 2>::from_slice(b"oops"), Err(PathError::PathTooLong));
assert_eq!(Path::<2, 2, 9>::from_slices(&[b"", b"", b""]), Err(PathError::TooManyComponents));
assert_eq!(Path::<4, 4, 9>::from_slice(b"oopsie"), Err(PathError::ComponentTooLong));Variants§
PathTooLong
The Path’s total length in bytes would have been greater than the max_path_length.
TooManyComponents
The Path would have had more Component than the max_component_count.
ComponentTooLong
The Path would have contained a Component of length greater than the max_component_length
Trait Implementations§
Source§impl Error for PathError
impl Error for PathError
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()
Source§impl From<InvalidComponentError> for PathError
impl From<InvalidComponentError> for PathError
Source§fn from(_value: InvalidComponentError) -> Self
fn from(_value: InvalidComponentError) -> Self
Converts to this type from the input type.
Source§impl From<PathFromComponentsError> for PathError
impl From<PathFromComponentsError> for PathError
Source§fn from(value: PathFromComponentsError) -> Self
fn from(value: PathFromComponentsError) -> Self
Converts to this type from the input type.
Source§impl Ord for PathError
impl Ord for PathError
Source§impl PartialOrd for PathError
impl PartialOrd for PathError
impl Eq for PathError
impl StructuralPartialEq for PathError
Auto Trait Implementations§
impl Freeze for PathError
impl RefUnwindSafe for PathError
impl Send for PathError
impl Sync for PathError
impl Unpin for PathError
impl UnwindSafe for PathError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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