Struct WithCustom

Source
pub struct WithCustom<Element, Parameters> {
    pub element: Element,
    pub parameters: Parameters,
}
Available on crate feature into-regex only.
Expand description

Parser of a Cucumber Expressions AST Element with custom Parameters in mind.

Usually, a Parameter is represented by a single Regex capturing group. In case there are multiple capturing groups, they will be named like __{parameter_id}_{group_id}. This is done to identify multiple capturing groups related to a single Parameter.

Fields§

§element: Element

Parsed element of a Cucumber Expressions AST.

§parameters: Parameters

Custom Parameters (in addition to default ones) to be used for expanding the Element into a Regex.

Trait Implementations§

Source§

impl<Element: Clone, Parameters: Clone> Clone for WithCustom<Element, Parameters>

Source§

fn clone(&self) -> WithCustom<Element, Parameters>

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<Element: Debug, Parameters: Debug> Debug for WithCustom<Element, Parameters>

Source§

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

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

impl<I, Pars> IntoRegexCharIter<I> for WithCustom<Expression<I>, Pars>
where I: Clone + Display + Input, <I as Input>::Item: AsChar, Pars: Clone + Provider<I>, <Pars as Provider<I>>::Value: Input,

Source§

type Iter = Chain<Chain<Once<Result<char, ParameterError<I>>>, FlatMap<Map<Zip<IntoIter<SingleExpression<I>>, Repeat<Pars>>, fn((SingleExpression<I>, Pars)) -> WithCustom<SingleExpression<I>, Pars>>, Either<<WithCustom<Parameter<I>, Pars> as IntoRegexCharIter<I>>::Iter, Either<<Alternation<I> as IntoRegexCharIter<I>>::Iter, Either<<Optional<I> as IntoRegexCharIter<I>>::Iter, Either<<Parameter<I> as IntoRegexCharIter<I>>::Iter, Map<EscapeForRegex<Map<<I as Input>::Iter, fn(<I as Input>::Item) -> char>>, fn(char) -> Result<char, ParameterError<I>>>>>>>, fn(WithCustom<SingleExpression<I>, Pars>) -> Either<<WithCustom<Parameter<I>, Pars> as IntoRegexCharIter<I>>::Iter, Either<<Alternation<I> as IntoRegexCharIter<I>>::Iter, Either<<Optional<I> as IntoRegexCharIter<I>>::Iter, Either<<Parameter<I> as IntoRegexCharIter<I>>::Iter, Map<EscapeForRegex<Map<<I as Input>::Iter, fn(<I as Input>::Item) -> char>>, fn(char) -> Result<char, ParameterError<I>>>>>>>>>, Once<Result<char, ParameterError<I>>>>

Type of Iterator performing the expansion.
Source§

fn into_regex_char_iter(self) -> Self::Iter

Consumes this AST element returning an Iterator over chars transformable into a Regex.
Source§

impl<I, P> IntoRegexCharIter<I> for WithCustom<Parameter<I>, P>
where I: Clone + Display + Input, <I as Input>::Item: AsChar, P: Provider<I>, <P as Provider<I>>::Value: Input,

Source§

type Iter = Either<Once<Result<char, ParameterError<I>>>, Either<Either<Either<Map<Chars<'static>, fn(char) -> Result<char, ParameterError<I>>>, Map<OwnedChars, fn(char) -> Result<char, ParameterError<I>>>>, Once<Result<char, ParameterError<I>>>>, Either<Chain<Chain<Map<Chars<'static>, fn(char) -> Result<char, ParameterError<I>>>, Map<OwnedChars, fn(char) -> Result<char, ParameterError<I>>>>, Once<Result<char, ParameterError<I>>>>, Chain<Chain<Once<Result<char, ParameterError<I>>>, Map<<<P as Provider<I>>::Value as Input>::Iter, fn(<<P as Provider<I>>::Value as Input>::Item) -> Result<char, ParameterError<I>>>>, Once<Result<char, ParameterError<I>>>>>>>

Type of Iterator performing the expansion.
Source§

fn into_regex_char_iter(self) -> Self::Iter

Consumes this AST element returning an Iterator over chars transformable into a Regex.
Source§

impl<I, Pars> IntoRegexCharIter<I> for WithCustom<SingleExpression<I>, Pars>
where I: Clone + Display + Input, <I as Input>::Item: AsChar, Pars: Provider<I>, <Pars as Provider<I>>::Value: Input,

Source§

type Iter = Either<<WithCustom<Parameter<I>, Pars> as IntoRegexCharIter<I>>::Iter, Either<<Alternation<I> as IntoRegexCharIter<I>>::Iter, Either<<Optional<I> as IntoRegexCharIter<I>>::Iter, Either<<Parameter<I> as IntoRegexCharIter<I>>::Iter, Map<EscapeForRegex<Map<<I as Input>::Iter, fn(<I as Input>::Item) -> char>>, fn(char) -> Result<char, ParameterError<I>>>>>>>

Type of Iterator performing the expansion.
Source§

fn into_regex_char_iter(self) -> Self::Iter

Consumes this AST element returning an Iterator over chars transformable into a Regex.
Source§

impl<Element: Copy, Parameters: Copy> Copy for WithCustom<Element, Parameters>

Auto Trait Implementations§

§

impl<Element, Parameters> Freeze for WithCustom<Element, Parameters>
where Element: Freeze, Parameters: Freeze,

§

impl<Element, Parameters> RefUnwindSafe for WithCustom<Element, Parameters>
where Element: RefUnwindSafe, Parameters: RefUnwindSafe,

§

impl<Element, Parameters> Send for WithCustom<Element, Parameters>
where Element: Send, Parameters: Send,

§

impl<Element, Parameters> Sync for WithCustom<Element, Parameters>
where Element: Sync, Parameters: Sync,

§

impl<Element, Parameters> Unpin for WithCustom<Element, Parameters>
where Element: Unpin, Parameters: Unpin,

§

impl<Element, Parameters> UnwindSafe for WithCustom<Element, Parameters>
where Element: UnwindSafe, Parameters: 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<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.