pub trait Facet: AsRef<str> + Debug + Default + PartialEq + Ord + Sized {
// Required methods
fn from_cow_str(facet: Cow<'_, str>) -> Self;
fn from_format_args(format_args: Arguments<'_>) -> Self;
// Provided methods
fn from_str(facet: &str) -> Self { ... }
fn from_string(facet: String) -> Self { ... }
fn from_prefix_with_date_suffix(
prefix: &str,
date: Date
) -> Result<Self, Format> { ... }
fn from_prefix_args_with_date_suffix(
prefix_args: Arguments<'_>,
date: Date
) -> Result<Self, Format> { ... }
fn is_valid(&self) -> bool { ... }
fn is_empty(&self) -> bool { ... }
fn has_date_like_suffix(&self) -> bool { ... }
fn try_split_into_prefix_and_date_like_suffix(&self) -> Option<(&str, &str)> { ... }
fn try_split_into_prefix_and_parse_date_suffix(
&self
) -> Option<(&str, Option<Date>)> { ... }
}
Expand description
Common trait for facets
Required Methods§
sourcefn from_cow_str(facet: Cow<'_, str>) -> Self
fn from_cow_str(facet: Cow<'_, str>) -> Self
Create a facet from a copy-on-write string.
sourcefn from_format_args(format_args: Arguments<'_>) -> Self
fn from_format_args(format_args: Arguments<'_>) -> Self
Create a facet from a precompiled format string.
Provided Methods§
sourcefn from_string(facet: String) -> Self
fn from_string(facet: String) -> Self
Create a facet from an owned string.
sourcefn from_prefix_args_with_date_suffix(
prefix_args: Arguments<'_>,
date: Date
) -> Result<Self, Format>
fn from_prefix_args_with_date_suffix( prefix_args: Arguments<'_>, date: Date ) -> Result<Self, Format>
sourcefn has_date_like_suffix(&self) -> bool
fn has_date_like_suffix(&self) -> bool
sourcefn try_split_into_prefix_and_date_like_suffix(&self) -> Option<(&str, &str)>
fn try_split_into_prefix_and_date_like_suffix(&self) -> Option<(&str, &str)>
Object Safety§
This trait is not object safe.