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>
impl<Element: Clone, Parameters: Clone> Clone for WithCustom<Element, Parameters>
Source§fn clone(&self) -> WithCustom<Element, Parameters>
fn clone(&self) -> WithCustom<Element, Parameters>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Input, Pars> IntoRegexCharIter<Input> for WithCustom<Expression<Input>, Pars>
impl<Input, Pars> IntoRegexCharIter<Input> for WithCustom<Expression<Input>, Pars>
Source§type Iter = Chain<Chain<Once<Result<char, ParameterError<Input>>>, FlatMap<Map<Zip<IntoIter<SingleExpression<Input>>, Repeat<Pars>>, fn(_: (SingleExpression<Input>, Pars)) -> WithCustom<SingleExpression<Input>, Pars>>, Either<<WithCustom<Parameter<Input>, Pars> as IntoRegexCharIter<Input>>::Iter, Either<<Alternation<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Optional<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Parameter<Input> as IntoRegexCharIter<Input>>::Iter, Map<EscapeForRegex<Map<<Input as InputIter>::IterElem, fn(_: <Input as InputIter>::Item) -> char>>, fn(_: char) -> Result<char, ParameterError<Input>>>>>>>, fn(_: WithCustom<SingleExpression<Input>, Pars>) -> Either<<WithCustom<Parameter<Input>, Pars> as IntoRegexCharIter<Input>>::Iter, Either<<Alternation<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Optional<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Parameter<Input> as IntoRegexCharIter<Input>>::Iter, Map<EscapeForRegex<Map<<Input as InputIter>::IterElem, fn(_: <Input as InputIter>::Item) -> char>>, fn(_: char) -> Result<char, ParameterError<Input>>>>>>>>>, Once<Result<char, ParameterError<Input>>>>
type Iter = Chain<Chain<Once<Result<char, ParameterError<Input>>>, FlatMap<Map<Zip<IntoIter<SingleExpression<Input>>, Repeat<Pars>>, fn(_: (SingleExpression<Input>, Pars)) -> WithCustom<SingleExpression<Input>, Pars>>, Either<<WithCustom<Parameter<Input>, Pars> as IntoRegexCharIter<Input>>::Iter, Either<<Alternation<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Optional<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Parameter<Input> as IntoRegexCharIter<Input>>::Iter, Map<EscapeForRegex<Map<<Input as InputIter>::IterElem, fn(_: <Input as InputIter>::Item) -> char>>, fn(_: char) -> Result<char, ParameterError<Input>>>>>>>, fn(_: WithCustom<SingleExpression<Input>, Pars>) -> Either<<WithCustom<Parameter<Input>, Pars> as IntoRegexCharIter<Input>>::Iter, Either<<Alternation<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Optional<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Parameter<Input> as IntoRegexCharIter<Input>>::Iter, Map<EscapeForRegex<Map<<Input as InputIter>::IterElem, fn(_: <Input as InputIter>::Item) -> char>>, fn(_: char) -> Result<char, ParameterError<Input>>>>>>>>>, Once<Result<char, ParameterError<Input>>>>
Type of an
Iterator
performing the expansion.Source§impl<Input, P> IntoRegexCharIter<Input> for WithCustom<Parameter<Input>, P>
impl<Input, P> IntoRegexCharIter<Input> for WithCustom<Parameter<Input>, P>
Source§type Iter = Either<Once<Result<char, ParameterError<Input>>>, Either<Either<Either<Map<Chars<'static>, fn(_: char) -> Result<char, ParameterError<Input>>>, Map<OwnedChars, fn(_: char) -> Result<char, ParameterError<Input>>>>, Once<Result<char, ParameterError<Input>>>>, Either<Chain<Chain<Map<Chars<'static>, fn(_: char) -> Result<char, ParameterError<Input>>>, Map<OwnedChars, fn(_: char) -> Result<char, ParameterError<Input>>>>, Once<Result<char, ParameterError<Input>>>>, Chain<Chain<Once<Result<char, ParameterError<Input>>>, Map<<<P as Provider<Input>>::Value as InputIter>::IterElem, fn(_: <<P as Provider<Input>>::Value as InputIter>::Item) -> Result<char, ParameterError<Input>>>>, Once<Result<char, ParameterError<Input>>>>>>>
type Iter = Either<Once<Result<char, ParameterError<Input>>>, Either<Either<Either<Map<Chars<'static>, fn(_: char) -> Result<char, ParameterError<Input>>>, Map<OwnedChars, fn(_: char) -> Result<char, ParameterError<Input>>>>, Once<Result<char, ParameterError<Input>>>>, Either<Chain<Chain<Map<Chars<'static>, fn(_: char) -> Result<char, ParameterError<Input>>>, Map<OwnedChars, fn(_: char) -> Result<char, ParameterError<Input>>>>, Once<Result<char, ParameterError<Input>>>>, Chain<Chain<Once<Result<char, ParameterError<Input>>>, Map<<<P as Provider<Input>>::Value as InputIter>::IterElem, fn(_: <<P as Provider<Input>>::Value as InputIter>::Item) -> Result<char, ParameterError<Input>>>>, Once<Result<char, ParameterError<Input>>>>>>>
Type of an
Iterator
performing the expansion.Source§impl<Input, Pars> IntoRegexCharIter<Input> for WithCustom<SingleExpression<Input>, Pars>
impl<Input, Pars> IntoRegexCharIter<Input> for WithCustom<SingleExpression<Input>, Pars>
Source§type Iter = Either<<WithCustom<Parameter<Input>, Pars> as IntoRegexCharIter<Input>>::Iter, Either<<Alternation<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Optional<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Parameter<Input> as IntoRegexCharIter<Input>>::Iter, Map<EscapeForRegex<Map<<Input as InputIter>::IterElem, fn(_: <Input as InputIter>::Item) -> char>>, fn(_: char) -> Result<char, ParameterError<Input>>>>>>>
type Iter = Either<<WithCustom<Parameter<Input>, Pars> as IntoRegexCharIter<Input>>::Iter, Either<<Alternation<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Optional<Input> as IntoRegexCharIter<Input>>::Iter, Either<<Parameter<Input> as IntoRegexCharIter<Input>>::Iter, Map<EscapeForRegex<Map<<Input as InputIter>::IterElem, fn(_: <Input as InputIter>::Item) -> char>>, fn(_: char) -> Result<char, ParameterError<Input>>>>>>>
Type of an
Iterator
performing the expansion.impl<Element: Copy, Parameters: Copy> Copy for WithCustom<Element, Parameters>
Auto Trait Implementations§
impl<Element, Parameters> Freeze for WithCustom<Element, Parameters>
impl<Element, Parameters> RefUnwindSafe for WithCustom<Element, Parameters>where
Element: RefUnwindSafe,
Parameters: RefUnwindSafe,
impl<Element, Parameters> Send for WithCustom<Element, Parameters>
impl<Element, Parameters> Sync for WithCustom<Element, Parameters>
impl<Element, Parameters> Unpin for WithCustom<Element, Parameters>
impl<Element, Parameters> UnwindSafe for WithCustom<Element, Parameters>where
Element: UnwindSafe,
Parameters: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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