PeekResult

Enum PeekResult 

Source
pub enum PeekResult<S, E> {
    Found {
        end_slice: usize,
        start: S,
        end: E,
    },
    NotFound,
}
Expand description

The result of a peeking operation.

A PeekResult contains the result of attempting to match a Peekable against the current position of a Scanner. If the match succeeds, a Found is returned with the length of the end slice, the start of the match, and the end of the match. If the match fails, a NotFound is returned.

Variants§

§

Found

The match was successful.

Fields

§end_slice: usize
§start: S
§end: E
§

NotFound

The match was unsuccessful.

Trait Implementations§

Source§

impl<S: Debug, E: Debug> Debug for PeekResult<S, E>

Source§

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

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

impl<S: PartialEq, E: PartialEq> PartialEq for PeekResult<S, E>

Source§

fn eq(&self, other: &PeekResult<S, E>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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.
Source§

impl<S, E> StructuralPartialEq for PeekResult<S, E>

Auto Trait Implementations§

§

impl<S, E> Freeze for PeekResult<S, E>
where S: Freeze, E: Freeze,

§

impl<S, E> RefUnwindSafe for PeekResult<S, E>

§

impl<S, E> Send for PeekResult<S, E>
where S: Send, E: Send,

§

impl<S, E> Sync for PeekResult<S, E>
where S: Sync, E: Sync,

§

impl<S, E> Unpin for PeekResult<S, E>
where S: Unpin, E: Unpin,

§

impl<S, E> UnwindSafe for PeekResult<S, E>
where S: UnwindSafe, E: UnwindSafe,

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> 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, 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.