[−][src]Struct dangerous::error::ExpectedLength
An error representing a failed requirement for a length of Input
.
Implementations
impl<'i> ExpectedLength<'i>
[src]
pub fn input(&self) -> &'i Input
[src]
The Input
provided in the context when the error occurred.
pub fn context(&self) -> ExpectedContext
[src]
The ExpectedContext
around the error.
pub fn span(&self) -> &'i Input
[src]
The specific part of the Input
that did not meet the requirement.
pub fn min(&self) -> usize
[src]
The minimum length that was expected in a context.
This doesn't not take into account the section of input being processed
when this error occurred. If you wish to work out the requirement to
continue processing input use
ToRetryRequirement::to_retry_requirement()
.
pub fn max(&self) -> Option<usize>
[src]
The maximum length that was expected in a context, if applicable.
If max has a value, this signifies the Input
exceeded it in some
way. An example of this would be Input::read_all()
, where there was
Input
left over.
pub fn is_exact(&self) -> bool
[src]
Returns true
if an exact length was expected in a context.
pub fn exact(&self) -> Option<usize>
[src]
The exact length that was expected in a context, if applicable.
Will return a value if is_exact()
returns true
.
Trait Implementations
impl<'i> Clone for ExpectedLength<'i>
[src]
fn clone(&self) -> ExpectedLength<'i>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'i> Debug for ExpectedLength<'i>
[src]
impl<'i> Display for ExpectedLength<'i>
[src]
impl<'i, S> From<ExpectedLength<'i>> for Expected<'i, S> where
S: ContextStackBuilder,
[src]
S: ContextStackBuilder,
fn from(err: ExpectedLength<'i>) -> Self
[src]
impl<'i> From<ExpectedLength<'i>> for Invalid
[src]
fn from(err: ExpectedLength<'i>) -> Self
[src]
impl<'i> ToRetryRequirement for ExpectedLength<'i>
[src]
fn to_retry_requirement(&self) -> Option<RetryRequirement>
[src]
fn is_fatal(&self) -> bool
[src]
Returns true
if max()
has a value.
Auto Trait Implementations
impl<'i> RefUnwindSafe for ExpectedLength<'i>
impl<'i> Send for ExpectedLength<'i>
impl<'i> Sync for ExpectedLength<'i>
impl<'i> Unpin for ExpectedLength<'i>
impl<'i> UnwindSafe for ExpectedLength<'i>
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>,