pub struct InfinityStr<'a>(/* private fields */);
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§
Source§impl<'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.
Trait Implementations§
Source§impl<'a> AsRef<str> for InfinityStr<'a>
impl<'a> AsRef<str> for InfinityStr<'a>
Source§impl<'a> Clone for InfinityStr<'a>
impl<'a> Clone for InfinityStr<'a>
Source§fn clone(&self) -> InfinityStr<'a>
fn clone(&self) -> InfinityStr<'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 InfinityStr<'a>
impl<'a> Debug for InfinityStr<'a>
Source§impl<'a> Display for InfinityStr<'a>
impl<'a> Display for InfinityStr<'a>
Source§impl<'a> Hash for InfinityStr<'a>
impl<'a> Hash for InfinityStr<'a>
Source§impl<'a> Ord for InfinityStr<'a>
impl<'a> Ord for InfinityStr<'a>
Source§fn cmp(&self, other: &InfinityStr<'a>) -> Ordering
fn cmp(&self, other: &InfinityStr<'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 InfinityStr<'a>
impl<'a> PartialEq for InfinityStr<'a>
Source§impl<'a> PartialOrd for InfinityStr<'a>
impl<'a> PartialOrd for InfinityStr<'a>
impl<'a> Eq for InfinityStr<'a>
impl<'a> StructuralPartialEq for InfinityStr<'a>
Auto Trait Implementations§
impl<'a> Freeze for InfinityStr<'a>
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§
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§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).