pub struct FixedString<const N: usize>(/* private fields */);
Expand description
A string with a maximum capacity of len <= N
.
Implementations§
Source§impl<const N: usize> FixedString<N>
impl<const N: usize> FixedString<N>
pub fn new(string: String) -> Result<Self, EncodeError>
Sourcepub unsafe fn new_unchecked(string: String) -> Self
pub unsafe fn new_unchecked(string: String) -> Self
§Safety
This function is unsafe because it does not check if the string is longer than the maximum length.
pub fn into_inner(self) -> String
Trait Implementations§
Source§impl<const N: usize> Clone for FixedString<N>
impl<const N: usize> Clone for FixedString<N>
Source§fn clone(&self) -> FixedString<N>
fn clone(&self) -> FixedString<N>
Returns a duplicate 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<const N: usize> Debug for FixedString<N>
impl<const N: usize> Debug for FixedString<N>
Source§impl<const N: usize> Decode for FixedString<N>
impl<const N: usize> Decode for FixedString<N>
fn decode(data: impl IntoIterator<Item = u8>) -> Result<Self, DecodeError>where
Self: Sized,
Source§impl<const N: usize> Display for FixedString<N>
impl<const N: usize> Display for FixedString<N>
Source§impl<const N: usize> Encode for FixedString<N>
impl<const N: usize> Encode for FixedString<N>
fn into_encoded(self) -> Result<Vec<u8>, EncodeError>where
Self: Sized,
Source§impl<const N: usize> FromStr for FixedString<N>
impl<const N: usize> FromStr for FixedString<N>
Source§impl<const N: usize> Hash for FixedString<N>
impl<const N: usize> Hash for FixedString<N>
Source§impl<const N: usize> Ord for FixedString<N>
impl<const N: usize> Ord for FixedString<N>
Source§fn cmp(&self, other: &FixedString<N>) -> Ordering
fn cmp(&self, other: &FixedString<N>) -> 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<const N: usize> PartialEq for FixedString<N>
impl<const N: usize> PartialEq for FixedString<N>
Source§impl<const N: usize> PartialOrd for FixedString<N>
impl<const N: usize> PartialOrd for FixedString<N>
Source§impl<const N: usize> TryFrom<&str> for FixedString<N>
impl<const N: usize> TryFrom<&str> for FixedString<N>
Source§type Error = EncodeError
type Error = EncodeError
The type returned in the event of a conversion error.
Source§fn try_from(value: &str) -> Result<FixedString<N>, EncodeError>
fn try_from(value: &str) -> Result<FixedString<N>, EncodeError>
Performs the conversion.
impl<const N: usize> Eq for FixedString<N>
impl<const N: usize> StructuralPartialEq for FixedString<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for FixedString<N>
impl<const N: usize> RefUnwindSafe for FixedString<N>
impl<const N: usize> Send for FixedString<N>
impl<const N: usize> Sync for FixedString<N>
impl<const N: usize> Unpin for FixedString<N>
impl<const N: usize> UnwindSafe for FixedString<N>
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more