Skip to main content

FailedStrategy

Struct FailedStrategy 

Source
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 S

Strategy.

§cause: V

Verification error.

Implementations§

Source§

impl<'a, T, S: Strategy, V> FailedStrategy<'a, T, S, V>

Source

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>

Source

pub fn empty(strategy: &'a S, cause: V) -> FailedStrategy<'a, T, S, V>

Creates an error for an empty result.

Source

pub fn map<U, F: FnOnce(V) -> U>(self, f: F) -> FailedStrategy<'a, T, S, U>

Applies a function to the cause.

Source

pub fn index(&self) -> Option<usize>

Get the unsigned index of the error.

Source

pub fn valid_forward(&self) -> RangeTo<usize>

Get the valid values in the forward direction.

Source

pub fn valid_backward(&self) -> RangeFrom<usize>

Get the valid values in the backward direction.

Trait Implementations§

Source§

impl<T, S: ?Sized, V: Clone> Clone for FailedStrategy<'_, T, S, V>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T, S: ?Sized, V: Copy> Copy for FailedStrategy<'_, T, S, V>

Source§

impl<T: Debug, S: ?Sized + Debug, V: Debug> Debug for FailedStrategy<'_, T, S, V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Debug, S: ?Sized + Display, V: Display> Display for FailedStrategy<'_, T, S, V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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>

Source§

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>

Source§

fn from(err: Infallible) -> FailedStrategy<'a, T, S, V>

Converts to this type from the input type.
Source§

impl<T: Hash, S: ?Sized + Hash, V: Hash> Hash for FailedStrategy<'_, T, S, V>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a, T: PartialEq, S: ?Sized + PartialEq, V: PartialEq> PartialEq for FailedStrategy<'a, T, S, V>

Source§

fn eq(&self, rhs: &FailedStrategy<'a, T, S, V>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<'a, T, S, V> Freeze for FailedStrategy<'a, T, S, V>
where V: Freeze, S: ?Sized,

§

impl<'a, T, S, V> RefUnwindSafe for FailedStrategy<'a, T, S, V>

§

impl<'a, T, S, V> Send for FailedStrategy<'a, T, S, V>
where V: Send, S: Sync + ?Sized, T: Sync,

§

impl<'a, T, S, V> Sync for FailedStrategy<'a, T, S, V>
where V: Sync, S: Sync + ?Sized, T: Sync,

§

impl<'a, T, S, V> Unpin for FailedStrategy<'a, T, S, V>
where V: Unpin, S: ?Sized,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V