Struct icu_relativetime::provider::SingularSubPattern
source · pub struct SingularSubPattern<'data> {
pub pattern: Cow<'data, str>,
pub index: u8,
}
Expand description
Singular substitution for pattern that optionally uses “{0}” as a placeholder.
Fields§
§pattern: Cow<'data, str>
The underlying pattern with the placeholder “{0}” removed.
index: u8
Denotes the substitution position in the pattern. Equals 255 if the pattern does not have a placeholder.
Implementations§
source§impl<'data> SingularSubPattern<'data>
impl<'data> SingularSubPattern<'data>
sourcepub fn try_from_str(value: &str) -> Result<Self, DataError>
pub fn try_from_str(value: &str) -> Result<Self, DataError>
Construct a singular sub pattern from a pattern
Trait Implementations§
source§impl<'data> Bake for SingularSubPattern<'data>
impl<'data> Bake for SingularSubPattern<'data>
source§fn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
source§impl<'data> Clone for SingularSubPattern<'data>
impl<'data> Clone for SingularSubPattern<'data>
source§fn clone(&self) -> SingularSubPattern<'data>
fn clone(&self) -> SingularSubPattern<'data>
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<'data> Debug for SingularSubPattern<'data>
impl<'data> Debug for SingularSubPattern<'data>
source§impl<'data> Default for SingularSubPattern<'data>
impl<'data> Default for SingularSubPattern<'data>
source§fn default() -> SingularSubPattern<'data>
fn default() -> SingularSubPattern<'data>
Returns the “default value” for a type. Read more
source§impl<'de: 'data, 'data> Deserialize<'de> for SingularSubPattern<'data>
impl<'de: 'data, 'data> Deserialize<'de> for SingularSubPattern<'data>
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<'data> PartialEq<SingularSubPattern<'data>> for SingularSubPattern<'data>
impl<'data> PartialEq<SingularSubPattern<'data>> for SingularSubPattern<'data>
source§fn eq(&self, other: &SingularSubPattern<'data>) -> bool
fn eq(&self, other: &SingularSubPattern<'data>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'data> Serialize for SingularSubPattern<'data>
impl<'data> Serialize for SingularSubPattern<'data>
source§impl<'a> Yokeable<'a> for SingularSubPattern<'static>
impl<'a> Yokeable<'a> for SingularSubPattern<'static>
§type Output = SingularSubPattern<'a>
type Output = SingularSubPattern<'a>
This type MUST be
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
source§fn transform_owned(self) -> Self::Output
fn transform_owned(self) -> Self::Output
source§unsafe fn make(this: Self::Output) -> Self
unsafe fn make(this: Self::Output) -> Self
This method can be used to cast away
Self<'a>
’s lifetime. Read moresource§fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
fn transform_mut<F>(&'a mut self, f: F)where F: 'static + for<'b> FnOnce(&'b mut Self::Output),
This method must cast
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moresource§impl<'zf, 'zf_inner> ZeroFrom<'zf, SingularSubPattern<'zf_inner>> for SingularSubPattern<'zf>
impl<'zf, 'zf_inner> ZeroFrom<'zf, SingularSubPattern<'zf_inner>> for SingularSubPattern<'zf>
source§fn zero_from(this: &'zf SingularSubPattern<'zf_inner>) -> Self
fn zero_from(this: &'zf SingularSubPattern<'zf_inner>) -> Self
Clone the other
C
into a struct that may retain references into C
.