[−][src]Struct dangerous::error::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]
fn clone(&self) -> RetryRequirement
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn eq(&self, other: &RetryRequirement) -> bool
[src]
fn ne(&self, other: &RetryRequirement) -> bool
[src]
impl StructuralEq for RetryRequirement
[src]
impl StructuralPartialEq for RetryRequirement
[src]
impl ToRetryRequirement for RetryRequirement
[src]
fn to_retry_requirement(&self) -> Option<RetryRequirement>
[src]
Auto Trait Implementations
impl RefUnwindSafe for RetryRequirement
impl Send for RetryRequirement
impl Sync for RetryRequirement
impl Unpin for RetryRequirement
impl UnwindSafe for RetryRequirement
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,