Enum pact_consumer::patterns::StringPattern
source · pub enum StringPattern {
String(String),
Pattern(Box<dyn Pattern<Matches = String>>),
}
Expand description
A pattern which matches or generates a string.
Variants§
String(String)
A literal string, which matches and generates itself.
Pattern(Box<dyn Pattern<Matches = String>>)
A nested pattern.
Implementations§
source§impl StringPattern
impl StringPattern
sourcepub fn pattern<P>(pattern: P) -> StringPattern
pub fn pattern<P>(pattern: P) -> StringPattern
Construct a string pattern from a type implementing Pattern
.
Trait Implementations§
source§impl Debug for StringPattern
impl Debug for StringPattern
source§impl<'a> From<&'a str> for StringPattern
impl<'a> From<&'a str> for StringPattern
source§impl From<DateTime<StringPattern>> for StringPattern
impl From<DateTime<StringPattern>> for StringPattern
source§fn from(pattern: DateTime<StringPattern>) -> Self
fn from(pattern: DateTime<StringPattern>) -> Self
Converts to this type from the input type.
source§impl From<Like<StringPattern>> for StringPattern
impl From<Like<StringPattern>> for StringPattern
source§fn from(pattern: Like<StringPattern>) -> Self
fn from(pattern: Like<StringPattern>) -> Self
Converts to this type from the input type.
source§impl<'a> From<String> for StringPattern
impl<'a> From<String> for StringPattern
source§impl From<Term<StringPattern>> for StringPattern
impl From<Term<StringPattern>> for StringPattern
source§fn from(pattern: Term<StringPattern>) -> Self
fn from(pattern: Term<StringPattern>) -> Self
Converts to this type from the input type.
source§impl Pattern for StringPattern
impl Pattern for StringPattern
§type Matches = String
type Matches = String
What type of data can this pattern be matched against? What kind of
example data does it generate?
source§fn to_example(&self) -> Self::Matches
fn to_example(&self) -> Self::Matches
Convert this
Matchable
into an example data value, stripping out
any special match rules.source§fn to_example_bytes(&self) -> Vec<u8> ⓘ
fn to_example_bytes(&self) -> Vec<u8> ⓘ
Convert this
Matchable
into an example data value as byte slice.source§fn extract_matching_rules(
&self,
path: DocPath,
rules_out: &mut MatchingRuleCategory
)
fn extract_matching_rules( &self, path: DocPath, rules_out: &mut MatchingRuleCategory )
Extract the matching rules from this
Matchable
, and insert them into
rules_out
, using path
as the base path. Read moreAuto Trait Implementations§
impl Freeze for StringPattern
impl !RefUnwindSafe for StringPattern
impl !Send for StringPattern
impl !Sync for StringPattern
impl Unpin for StringPattern
impl !UnwindSafe for StringPattern
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request