Struct num_format::utils::SeparatorStr
source · pub struct SeparatorStr<'a>(_);
Expand description
Simple wrapper type for a &str
to make sure its length is less than the maximum for
a separator (8 bytes).
Implementations§
source§impl<'a> SeparatorStr<'a>
impl<'a> SeparatorStr<'a>
sourcepub fn new(s: &'a str) -> Result<SeparatorStr<'a>, Error>
pub fn new(s: &'a str) -> Result<SeparatorStr<'a>, Error>
Constructs an SeparatorStr
, ensuring that the length is less than the maximum for
a separator (8 bytes).
Errors
Returns an error if the provided &str
’s length is more than 8 bytes.
Trait Implementations§
source§impl<'a> AsRef<str> for SeparatorStr<'a>
impl<'a> AsRef<str> for SeparatorStr<'a>
source§impl<'a> Clone for SeparatorStr<'a>
impl<'a> Clone for SeparatorStr<'a>
source§fn clone(&self) -> SeparatorStr<'a>
fn clone(&self) -> SeparatorStr<'a>
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<'a> Debug for SeparatorStr<'a>
impl<'a> Debug for SeparatorStr<'a>
source§impl<'a> Display for SeparatorStr<'a>
impl<'a> Display for SeparatorStr<'a>
source§impl<'a> Hash for SeparatorStr<'a>
impl<'a> Hash for SeparatorStr<'a>
source§impl<'a> Ord for SeparatorStr<'a>
impl<'a> Ord for SeparatorStr<'a>
source§fn cmp(&self, other: &SeparatorStr<'a>) -> Ordering
fn cmp(&self, other: &SeparatorStr<'a>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a> PartialEq<SeparatorStr<'a>> for SeparatorStr<'a>
impl<'a> PartialEq<SeparatorStr<'a>> for SeparatorStr<'a>
source§fn eq(&self, other: &SeparatorStr<'a>) -> bool
fn eq(&self, other: &SeparatorStr<'a>) -> bool
source§impl<'a> PartialOrd<SeparatorStr<'a>> for SeparatorStr<'a>
impl<'a> PartialOrd<SeparatorStr<'a>> for SeparatorStr<'a>
source§fn partial_cmp(&self, other: &SeparatorStr<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &SeparatorStr<'a>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more