Struct num_format::utils::SeparatorStr
source · pub struct SeparatorStr<'a>(/* private fields */);
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 for SeparatorStr<'a>
impl<'a> PartialEq for SeparatorStr<'a>
source§fn eq(&self, other: &SeparatorStr<'a>) -> bool
fn eq(&self, other: &SeparatorStr<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialOrd for SeparatorStr<'a>
impl<'a> PartialOrd 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 moreimpl<'a> Eq for SeparatorStr<'a>
impl<'a> StructuralPartialEq for SeparatorStr<'a>
Auto Trait Implementations§
impl<'a> Freeze for SeparatorStr<'a>
impl<'a> RefUnwindSafe for SeparatorStr<'a>
impl<'a> Send for SeparatorStr<'a>
impl<'a> Sync for SeparatorStr<'a>
impl<'a> Unpin for SeparatorStr<'a>
impl<'a> UnwindSafe for SeparatorStr<'a>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<S> ParseFormatted for S
impl<S> ParseFormatted for S
source§fn parse_formatted<F, N>(&self, format: &F) -> Result<N, Error>where
F: Format,
N: FromFormattedStr,
fn parse_formatted<F, N>(&self, format: &F) -> Result<N, Error>where
F: Format,
N: FromFormattedStr,
Converts
self
(typically a formatted string) into a number (see Examples above).