Struct Span

Source
pub struct Span<I, P>(pub I, pub P);
Expand description

This input type keeps track of the position within the input it wraps.

Tuple Fields§

§0: I§1: P

Implementations§

Source§

impl<I, P: Position<I>> Span<I, P>

Source

pub fn new(input: I) -> Self

Examples found in repository?
examples/lisp.rs (line 122)
121pub fn parse(i: &str) -> Result<Value, ParserError> {
122    (cf::f(parse_partial) >> -sp::ws(..)).parse(ParserInput::new(i))
123}

Trait Implementations§

Source§

impl<I, P: Position<I>, E: AltError<I>> AltError<Span<I, P>> for PositionedError<P, E>

Source§

fn alt(self, other: Self, at: Span<I, P>) -> Self

Source§

impl<I: Clone, P: Clone> Clone for Span<I, P>

Source§

fn clone(&self) -> Span<I, P>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<I: SplitFirst + Clone, P: Position<I>, E> ConsumeError<Span<I, P>> for PositionedError<P, E>
where E: ConsumeError<I>,

Source§

fn eof(at: Span<I, P>) -> Self

Source§

fn condition_failed(element: I::Element, at: Span<I, P>) -> Self

Source§

impl<I: Debug, P: Debug> Debug for Span<I, P>

Source§

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

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

impl<I, P: Position<I>, E: EofError<I>> EofError<Span<I, P>> for PositionedError<P, E>

Source§

fn no_eof(at: Span<I, P>) -> Self

Source§

impl<I: HasEof, P> HasEof for Span<I, P>

Source§

fn at_eof(&self) -> bool

Source§

impl<I: Hash, P: Hash> Hash for Span<I, P>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<I, P: Position<I>, E: NotError<O, I>, O> NotError<O, Span<I, P>> for PositionedError<P, E>

Source§

fn not(out: O, at: Span<I, P>) -> Self

Source§

impl<I: PartialEq, P: PartialEq> PartialEq for Span<I, P>

Source§

fn eq(&self, other: &Span<I, P>) -> 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<I: Recordable, P> Recordable for Span<I, P>

Source§

type Output = <I as Recordable>::Output

Source§

fn record(self, later: Self) -> Self::Output

Source§

impl<I: Clone + SplitFirst, P: Position<I>> SplitFirst for Span<I, P>

Source§

type Element = <I as SplitFirst>::Element

Source§

fn split_first(self) -> Option<(Self::Element, Self)>

Source§

impl<'a, I, P: Position<I>, E, T: ?Sized> TagError<'a, T, Span<I, P>> for PositionedError<P, E>
where E: TagError<'a, T, I>,

Source§

fn tag(tag: &'a T, at: Span<I, P>) -> Self

Source§

impl<I: Copy, P: Copy> Copy for Span<I, P>

Source§

impl<I: Eq, P: Eq> Eq for Span<I, P>

Source§

impl<I, P> StructuralPartialEq for Span<I, P>

Auto Trait Implementations§

§

impl<I, P> Freeze for Span<I, P>
where I: Freeze, P: Freeze,

§

impl<I, P> RefUnwindSafe for Span<I, P>

§

impl<I, P> Send for Span<I, P>
where I: Send, P: Send,

§

impl<I, P> Sync for Span<I, P>
where I: Sync, P: Sync,

§

impl<I, P> Unpin for Span<I, P>
where I: Unpin, P: Unpin,

§

impl<I, P> UnwindSafe for Span<I, P>
where I: UnwindSafe, P: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<I, P, T> Tag<Span<I, P>> for T
where I: Clone, P: Position<I>, T: Tag<I> + ?Sized,

Source§

type Output = <T as Tag<I>>::Output

Source§

fn parse_tag( &self, inp: Span<I, P>, ) -> Option<(<T as Tag<Span<I, P>>>::Output, Span<I, P>)>

The return type is reversed, since the tag is the beginning of the input.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.