Enum nom::Needed [−][src]
pub enum Needed { Unknown, Size(NonZeroUsize), }
Contains information on needed data if a parser returned Incomplete
Variants
Needs more data, but we do not know how much
Size(NonZeroUsize)
Contains the required data size in bytes
Implementations
impl Needed
[src]
pub fn new(s: usize) -> Self
[src]
Creates Needed
instance, returns Needed::Unknown
if the argument is zero
pub fn is_known(&self) -> bool
[src]
Indicates if we know how many bytes we need
pub fn map<F: Fn(NonZeroUsize) -> usize>(self, f: F) -> Needed
[src]
Maps a Needed
to Needed
by applying a function to a contained Size
value.
Trait Implementations
impl Clone for Needed
[src]
fn clone(&self) -> Needed
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Needed
[src]
impl Debug for Needed
[src]
impl Eq for Needed
[src]
impl PartialEq<Needed> for Needed
[src]
impl StructuralEq for Needed
[src]
impl StructuralPartialEq for Needed
[src]
Auto Trait Implementations
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,
pub 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, 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.
pub 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>,