pub struct PatternString<B: PatternBackend>(pub Box<Pattern<B>>);
Tuple Fields§
§0: Box<Pattern<B>>
Methods from Deref<Target = Pattern<B>>§
Sourcepub fn iter(
&self,
) -> impl Iterator<Item = PatternItem<'_, B::PlaceholderKey<'_>>> + '_
pub fn iter( &self, ) -> impl Iterator<Item = PatternItem<'_, B::PlaceholderKey<'_>>> + '_
Returns an iterator over the PatternItem
s in this pattern.
Sourcepub fn try_interpolate<'a, P>(
&'a self,
value_provider: P,
) -> impl TryWriteable<Error = B::Error<'a>> + Display + 'a
pub fn try_interpolate<'a, P>( &'a self, value_provider: P, ) -> impl TryWriteable<Error = B::Error<'a>> + Display + 'a
Returns a TryWriteable
that interpolates items from the given replacement provider
into this pattern string.
Sourcepub fn try_interpolate_to_string<'a, P>(
&'a self,
value_provider: P,
) -> Result<String, (B::Error<'a>, String)>
pub fn try_interpolate_to_string<'a, P>( &'a self, value_provider: P, ) -> Result<String, (B::Error<'a>, String)>
Interpolates the pattern directly to a string, returning the string or an error.
In addition to the error, the lossy fallback string is returned in the failure case.
✨ Enabled with the alloc
Cargo feature.
Sourcepub fn interpolate<'a, P>(
&'a self,
value_provider: P,
) -> impl Writeable + Display + 'a
pub fn interpolate<'a, P>( &'a self, value_provider: P, ) -> impl Writeable + Display + 'a
Returns a Writeable
that interpolates items from the given replacement provider
into this pattern string.
Sourcepub fn interpolate_to_string<'a, P>(&'a self, value_provider: P) -> String
pub fn interpolate_to_string<'a, P>(&'a self, value_provider: P) -> String
Interpolates the pattern directly to a string.
✨ Enabled with the alloc
Cargo feature.
Trait Implementations§
Source§impl<B: PatternBackend> Clone for PatternString<B>
impl<B: PatternBackend> Clone for PatternString<B>
Source§impl<B: Debug + PatternBackend> Debug for PatternString<B>
impl<B: Debug + PatternBackend> Debug for PatternString<B>
Source§impl<B: PatternBackend> Default for PatternString<B>
impl<B: PatternBackend> Default for PatternString<B>
Source§impl<B: PatternBackend> Deref for PatternString<B>
impl<B: PatternBackend> Deref for PatternString<B>
Source§impl<'de, B: PatternBackend> Deserialize<'de> for PatternString<B>
impl<'de, B: PatternBackend> Deserialize<'de> for PatternString<B>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<B: PartialEq + PatternBackend> PartialEq for PatternString<B>
impl<B: PartialEq + PatternBackend> PartialEq for PatternString<B>
impl<B: PatternBackend> StructuralPartialEq for PatternString<B>
Auto Trait Implementations§
impl<B> Freeze for PatternString<B>
impl<B> RefUnwindSafe for PatternString<B>
impl<B> Send for PatternString<B>
impl<B> Sync for PatternString<B>
impl<B> Unpin for PatternString<B>
impl<B> UnwindSafe for PatternString<B>
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