Struct Wrap

Source
pub struct Wrap<I>{ /* private fields */ }

Implementations§

Source§

impl<I> Wrap<I>

Source

pub fn new(input: I) -> Self

Trait Implementations§

Source§

impl<I> AsBytes for Wrap<I>

Source§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
Source§

impl<I> Clone for Wrap<I>

Source§

fn clone(&self) -> Wrap<I>

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<'a> Compare<&'static str> for Wrap<LocatedSpan<&'a str, Arc<String>>>

Source§

fn compare(&self, t: &str) -> CompareResult

Compares self to another value for equality
Source§

fn compare_no_case(&self, t: &str) -> CompareResult

Compares self to another value for equality independently of the case. Read more
Source§

impl<I> Debug for Wrap<I>

Source§

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

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

impl<I> Deref for Wrap<I>

Source§

type Target = I

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a> FindSubstring<&str> for Wrap<LocatedSpan<&'a str, Arc<String>>>

Source§

fn find_substring(&self, substr: &str) -> Option<usize>

Returns the byte position of the substring if it is found
Source§

impl<I> InputIter for Wrap<I>

Source§

type Item = <I as InputIter>::Item

The current input type is a sequence of that Item type. Read more
Source§

type Iter = <I as InputIter>::Iter

An iterator over the input type, producing the item and its position for use with Slice. If we’re iterating over &str, the position corresponds to the byte index of the character
Source§

type IterElem = <I as InputIter>::IterElem

An iterator over the input type, producing the item
Source§

fn iter_indices(&self) -> Self::Iter

Returns an iterator over the elements and their byte offsets
Source§

fn iter_elements(&self) -> Self::IterElem

Returns an iterator over the elements
Source§

fn position<P>(&self, predicate: P) -> Option<usize>
where P: Fn(Self::Item) -> bool,

Finds the byte position of the element
Source§

fn slice_index(&self, count: usize) -> Result<usize, Needed>

Get the byte offset from the element’s position in the stream
Source§

impl<I> InputLength for Wrap<I>

Source§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name, and the name of the trait itself
Source§

impl<I> InputTake for Wrap<I>

Source§

fn take(&self, count: usize) -> Self

Returns a slice of count bytes. panics if count > length
Source§

fn take_split(&self, count: usize) -> (Self, Self)

Split the stream at the count byte offset. panics if count > length
Source§

impl<I> InputTakeAtPosition for Wrap<I>

Source§

type Item = <I as InputIter>::Item

The current input type is a sequence of that Item type. Read more
Source§

fn split_at_position<P, E: ParseError<Self>>( &self, predicate: P, ) -> IResult<Self, Self, E>
where P: Fn(Self::Item) -> bool,

Looks for the first element of the input type for which the condition returns true, and returns the input up to this position. Read more
Source§

fn split_at_position1<P, E: ParseError<Self>>( &self, predicate: P, e: ErrorKind, ) -> IResult<Self, Self, E>
where P: Fn(Self::Item) -> bool,

Looks for the first element of the input type for which the condition returns true and returns the input up to this position. Read more
Source§

fn split_at_position_complete<P, E: ParseError<Self>>( &self, predicate: P, ) -> IResult<Self, Self, E>
where P: Fn(Self::Item) -> bool,

Looks for the first element of the input type for which the condition returns true, and returns the input up to this position. Read more
Source§

fn split_at_position1_complete<P, E: ParseError<Self>>( &self, predicate: P, e: ErrorKind, ) -> IResult<Self, Self, E>
where P: Fn(Self::Item) -> bool,

Looks for the first element of the input type for which the condition returns true and returns the input up to this position. Read more
Source§

impl<I> Offset for Wrap<I>

Source§

fn offset(&self, second: &Self) -> usize

Offset between the first byte of self and the first byte of the argument
Source§

impl<I> Slice<Range<usize>> for Wrap<I>

Source§

fn slice(&self, range: Range<usize>) -> Self

Slices self according to the range argument
Source§

impl<I> Slice<RangeFrom<usize>> for Wrap<I>

Source§

fn slice(&self, range: RangeFrom<usize>) -> Self

Slices self according to the range argument
Source§

impl<I> Slice<RangeTo<usize>> for Wrap<I>

Source§

fn slice(&self, range: RangeTo<usize>) -> Self

Slices self according to the range argument
Source§

impl<'a> Span for Wrap<LocatedSpan<&'a str, Arc<String>>>

Source§

impl<I> ToString for Wrap<I>

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more

Auto Trait Implementations§

§

impl<I> Freeze for Wrap<I>
where I: Freeze,

§

impl<I> RefUnwindSafe for Wrap<I>
where I: RefUnwindSafe,

§

impl<I> Send for Wrap<I>
where I: Send,

§

impl<I> Sync for Wrap<I>
where I: Sync,

§

impl<I> Unpin for Wrap<I>
where I: Unpin,

§

impl<I> UnwindSafe for Wrap<I>
where I: 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<I, T> ExtractContext<I, ()> for T

Source§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<I> RecreateContext<I> for I

Source§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
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.