pub struct Error<T: ?Sized, P: Predicate<T> + ?Sized, C: TypeStr + ?Sized = NoContext> { /* private fields */ }Expand description
Represents errors that occur when the value of type T does not satisfy the predicate P.
The context C provides additional information about the error, and defaults to NoContext.
For instance, False expects nothing and its code is false, so the error message is:
expected nothing (no context) [false]Implementations§
Trait Implementations§
Source§impl<T: ?Sized, P: Predicate<T> + ?Sized, C: TypeStr + ?Sized> Error for Error<T, P, C>
impl<T: ?Sized, P: Predicate<T> + ?Sized, C: TypeStr + ?Sized> Error for Error<T, P, C>
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<T, P, C> Freeze for Error<T, P, C>
impl<T, P, C> RefUnwindSafe for Error<T, P, C>
impl<T, P, C> Send for Error<T, P, C>
impl<T, P, C> Sync for Error<T, P, C>
impl<T, P, C> Unpin for Error<T, P, C>
impl<T, P, C> UnsafeUnpin for Error<T, P, C>
impl<T, P, C> UnwindSafe for Error<T, P, C>
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<T> Refine for Twhere
T: ?Sized,
impl<T> Refine for Twhere
T: ?Sized,
Source§fn refine_ref<R: Refining<Value = Self> + ?Sized>(
&self,
) -> RecoverableRefinementRef<'_, R>
fn refine_ref<R: Refining<Value = Self> + ?Sized>( &self, ) -> RecoverableRefinementRef<'_, R>
Refines the given value with
R by reference. Read more