Struct NotEscaped

Source
pub struct NotEscaped<Prefix, Inner>(pub Prefix, pub Inner);
Expand description

Pattern that matches pattern Inner not escaped by Prefix. “escaped” here means that the pattern Inner is preceded by an odd number of contiguous Prefixes.

For example, for a pattern NotEscaped('\', '0'), the strings “0”, “\0” & “\\\0” will have a match, but the strings “\0”, “\ \0” & “\\\\0” won’t.

Tuple Fields§

§0: Prefix§1: Inner

Trait Implementations§

Source§

impl<Prefix: Pattern, Inner: Pattern> Pattern for NotEscaped<Prefix, Inner>

Source§

fn immediate_match<I: Input>(&self, input: I) -> Result<(I, I), I>

The return values are (rest of the input, matched fragment at the beginning). Read more
Source§

fn trailing_match<I: Input>(&self, input: I) -> Result<(I, I), I>

Like Pattern::immediate_match, but matches at the end of input. The return values are (the input before the match, the match) Read more
Source§

fn trailing_matches_counted<I: Input>(&self, input: I) -> (I, usize)

Like Pattern::immediate_matches_counted, but matches at the end of input, and doesn’t return the matched fragment of the input. Read more
Source§

fn first_match<I: Input>(&self, input: I) -> Result<(I, (I, I)), I>

The return values are (the match + rest of the input, (string before the match, the match)). Read more
Source§

fn first_match_ex<I: Input>(&self, input: I) -> Result<(I, (I, I)), I>

Like Pattern::first_match, but the match is excluded from the rest of the input. Read more
Source§

fn immediate_matches<I: Input>(&self, input: I) -> (I, I)

The return values are (rest of the input, contiguous matched fragments from the beginning). Read more
Source§

fn immediate_matches_counted<I: Input>(&self, input: I) -> (I, (I, usize))

Like Pattern::immediate_matches, but also counts the number of matches. Read more
Source§

fn by_ref(&self) -> impl Pattern + Copy

Get the pattern by reference to avoid moving it, which will happen in generic code Read more

Auto Trait Implementations§

§

impl<Prefix, Inner> Freeze for NotEscaped<Prefix, Inner>
where Prefix: Freeze, Inner: Freeze,

§

impl<Prefix, Inner> RefUnwindSafe for NotEscaped<Prefix, Inner>
where Prefix: RefUnwindSafe, Inner: RefUnwindSafe,

§

impl<Prefix, Inner> Send for NotEscaped<Prefix, Inner>
where Prefix: Send, Inner: Send,

§

impl<Prefix, Inner> Sync for NotEscaped<Prefix, Inner>
where Prefix: Sync, Inner: Sync,

§

impl<Prefix, Inner> Unpin for NotEscaped<Prefix, Inner>
where Prefix: Unpin, Inner: Unpin,

§

impl<Prefix, Inner> UnwindSafe for NotEscaped<Prefix, Inner>
where Prefix: UnwindSafe, Inner: 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.