Struct num_format::utils::MinusSignStr
source · pub struct MinusSignStr<'a>(_);
Expand description
Simple wrapper type for a &str
to make sure its length is less than the maximum for
a minus sign (8 bytes).
Implementations§
source§impl<'a> MinusSignStr<'a>
impl<'a> MinusSignStr<'a>
sourcepub fn new(s: &'a str) -> Result<MinusSignStr<'a>, Error>
pub fn new(s: &'a str) -> Result<MinusSignStr<'a>, Error>
Constructs a MinusSignStr
, ensuring that the length is less than the maximum for
a minus sign (8 bytes).
Errors
Returns an error if the provided &str
’s length is more than 7 bytes.
Trait Implementations§
source§impl<'a> AsRef<str> for MinusSignStr<'a>
impl<'a> AsRef<str> for MinusSignStr<'a>
source§impl<'a> Clone for MinusSignStr<'a>
impl<'a> Clone for MinusSignStr<'a>
source§fn clone(&self) -> MinusSignStr<'a>
fn clone(&self) -> MinusSignStr<'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 MinusSignStr<'a>
impl<'a> Debug for MinusSignStr<'a>
source§impl<'a> Display for MinusSignStr<'a>
impl<'a> Display for MinusSignStr<'a>
source§impl<'a> Hash for MinusSignStr<'a>
impl<'a> Hash for MinusSignStr<'a>
source§impl<'a> Ord for MinusSignStr<'a>
impl<'a> Ord for MinusSignStr<'a>
source§fn cmp(&self, other: &MinusSignStr<'a>) -> Ordering
fn cmp(&self, other: &MinusSignStr<'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<MinusSignStr<'a>> for MinusSignStr<'a>
impl<'a> PartialEq<MinusSignStr<'a>> for MinusSignStr<'a>
source§fn eq(&self, other: &MinusSignStr<'a>) -> bool
fn eq(&self, other: &MinusSignStr<'a>) -> bool
source§impl<'a> PartialOrd<MinusSignStr<'a>> for MinusSignStr<'a>
impl<'a> PartialOrd<MinusSignStr<'a>> for MinusSignStr<'a>
source§fn partial_cmp(&self, other: &MinusSignStr<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &MinusSignStr<'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