[][src]Struct dangerous::error::RetryRequirement

pub struct RetryRequirement(_);

An indicator of how many bytes are required to continue processing input.

Although the value allows you to estimate how much more input you need till you can continue processing the input, it is a very granular value and may result in a lot of wasted reprocessing of input if not handled correctly.

Implementations

impl RetryRequirement[src]

pub fn new(value: usize) -> Option<Self>[src]

Create a new RetryRequirement.

If the provided value is 0, this signifies processing can't be retried. If the provided value is greater than 0, this signifies the amount of additional input bytes required to continue processing.

pub fn from_had_and_needed(had: usize, needed: usize) -> Option<Self>[src]

Create a retry requirement from a count of how many bytes we had and how many we needed.

pub fn met_by(self, count: usize) -> bool[src]

Returns true if a provided count meets the requirement.

pub fn continue_after(self) -> usize[src]

An indicator of how many bytes are required to continue processing input, if applicable.

Although the value allows you to estimate how much more input you need till you can continue processing the input, it is a very granular value and may result in a lot of wasted reprocessing of input if not handled correctly.

pub fn continue_after_non_zero(self) -> NonZeroUsize[src]

Returns a NonZeroUsize wrapped variant of continue_after.

Trait Implementations

impl Clone for RetryRequirement[src]

impl Copy for RetryRequirement[src]

impl Debug for RetryRequirement[src]

impl Display for RetryRequirement[src]

impl Eq for RetryRequirement[src]

impl PartialEq<RetryRequirement> for RetryRequirement[src]

impl StructuralEq for RetryRequirement[src]

impl StructuralPartialEq for RetryRequirement[src]

impl ToRetryRequirement for RetryRequirement[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.