Struct num_format::utils::InfinityStr
source · [−]pub struct InfinityStr<'a>(_);
Expand description
Simple wrapper type for a &str
to make sure its length is less than the maximum for
an infinity symbol (128 bytes).
Implementations
sourceimpl<'a> InfinityStr<'a>
impl<'a> InfinityStr<'a>
sourcepub fn new(s: &'a str) -> Result<InfinityStr<'a>, Error>
pub fn new(s: &'a str) -> Result<InfinityStr<'a>, Error>
Constructs an InfinityStr
, ensuring that the length is less than the maximum for
an infinity symbol (128 bytes).
Errors
Returns an error if the provided &str
’s length is more than 128 bytes.
sourceimpl<'a> InfinityStr<'a>
impl<'a> InfinityStr<'a>
Trait Implementations
sourceimpl<'a> AsRef<str> for InfinityStr<'a>
impl<'a> AsRef<str> for InfinityStr<'a>
sourceimpl<'a> Clone for InfinityStr<'a>
impl<'a> Clone for InfinityStr<'a>
sourcefn clone(&self) -> InfinityStr<'a>
fn clone(&self) -> InfinityStr<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<'a> Debug for InfinityStr<'a>
impl<'a> Debug for InfinityStr<'a>
sourceimpl<'a> Display for InfinityStr<'a>
impl<'a> Display for InfinityStr<'a>
sourceimpl<'a> Hash for InfinityStr<'a>
impl<'a> Hash for InfinityStr<'a>
sourceimpl<'a> Ord for InfinityStr<'a>
impl<'a> Ord for InfinityStr<'a>
sourcefn cmp(&self, other: &InfinityStr<'a>) -> Ordering
fn cmp(&self, other: &InfinityStr<'a>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<'a> PartialEq<InfinityStr<'a>> for InfinityStr<'a>
impl<'a> PartialEq<InfinityStr<'a>> for InfinityStr<'a>
sourcefn eq(&self, other: &InfinityStr<'a>) -> bool
fn eq(&self, other: &InfinityStr<'a>) -> bool
sourceimpl<'a> PartialOrd<InfinityStr<'a>> for InfinityStr<'a>
impl<'a> PartialOrd<InfinityStr<'a>> for InfinityStr<'a>
sourcefn partial_cmp(&self, other: &InfinityStr<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &InfinityStr<'a>) -> Option<Ordering>
1.0.0 · sourcefn 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 InfinityStr<'a>
impl<'a> StructuralEq for InfinityStr<'a>
impl<'a> StructuralPartialEq for InfinityStr<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for InfinityStr<'a>
impl<'a> Send for InfinityStr<'a>
impl<'a> Sync for InfinityStr<'a>
impl<'a> Unpin for InfinityStr<'a>
impl<'a> UnwindSafe for InfinityStr<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more