pub struct FailedStrategy<'a, T, S: ?Sized, V> {
pub strategy: &'a S,
pub cause: V,
/* private fields */
}Expand description
Error indicating that a strategy failed at a particular position.
Fields§
§strategy: &'a SStrategy.
cause: VVerification error.
Implementations§
Source§impl<'a, T, S: Strategy, V> FailedStrategy<'a, T, S, V>
impl<'a, T, S: Strategy, V> FailedStrategy<'a, T, S, V>
Sourcepub fn erased_strategy(self) -> FailedStrategy<'a, T, dyn StrategyObj + 'a, V>
pub fn erased_strategy(self) -> FailedStrategy<'a, T, dyn StrategyObj + 'a, V>
Erase the strategy type, so the error can be more general.
Source§impl<'a, T, S: ?Sized, V> FailedStrategy<'a, T, S, V>
impl<'a, T, S: ?Sized, V> FailedStrategy<'a, T, S, V>
Sourcepub fn empty(strategy: &'a S, cause: V) -> FailedStrategy<'a, T, S, V>
pub fn empty(strategy: &'a S, cause: V) -> FailedStrategy<'a, T, S, V>
Creates an error for an empty result.
Sourcepub fn map<U, F: FnOnce(V) -> U>(self, f: F) -> FailedStrategy<'a, T, S, U>
pub fn map<U, F: FnOnce(V) -> U>(self, f: F) -> FailedStrategy<'a, T, S, U>
Applies a function to the cause.
Sourcepub fn valid_forward(&self) -> RangeTo<usize>
pub fn valid_forward(&self) -> RangeTo<usize>
Get the valid values in the forward direction.
Sourcepub fn valid_backward(&self) -> RangeFrom<usize>
pub fn valid_backward(&self) -> RangeFrom<usize>
Get the valid values in the backward direction.
Trait Implementations§
impl<T, S: ?Sized, V: Copy> Copy for FailedStrategy<'_, T, S, V>
impl<T: Eq, S: ?Sized + Eq, V: Eq> Eq for FailedStrategy<'_, T, S, V>
Source§impl<'a, A: ?Sized + Accum, S: ?Sized, V> From<FailedStrategy<'a, <A as Accum>::Item, S, V>> for AccumVerifyError<'a, A, S, V>
impl<'a, A: ?Sized + Accum, S: ?Sized, V> From<FailedStrategy<'a, <A as Accum>::Item, S, V>> for AccumVerifyError<'a, A, S, V>
Source§fn from(err: FailedStrategy<'a, A::Item, S, V>) -> AccumVerifyError<'a, A, S, V>
fn from(err: FailedStrategy<'a, A::Item, S, V>) -> AccumVerifyError<'a, A, S, V>
Converts to this type from the input type.
Source§impl<'a, T, S: ?Sized, V> From<Infallible> for FailedStrategy<'a, T, S, V>
impl<'a, T, S: ?Sized, V> From<Infallible> for FailedStrategy<'a, T, S, V>
Source§fn from(err: Infallible) -> FailedStrategy<'a, T, S, V>
fn from(err: Infallible) -> FailedStrategy<'a, T, S, V>
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a, T, S, V> Freeze for FailedStrategy<'a, T, S, V>
impl<'a, T, S, V> RefUnwindSafe for FailedStrategy<'a, T, S, V>
impl<'a, T, S, V> Send for FailedStrategy<'a, T, S, V>
impl<'a, T, S, V> Sync for FailedStrategy<'a, T, S, V>
impl<'a, T, S, V> Unpin for FailedStrategy<'a, T, S, V>
impl<'a, T, S, V> UnsafeUnpin for FailedStrategy<'a, T, S, V>where
V: UnsafeUnpin,
S: ?Sized,
impl<'a, T, S, V> UnwindSafe for FailedStrategy<'a, T, S, V>
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