pub struct String<const LEN: usize>(/* private fields */);Expand description
Represents a fixed-length byte string.
This type can be created from a &str or &[u8] if their byte
length does not exceed the fixed length.
It can be freely converted from and to a [u8; N] array, and
to a Vec<u8> where it will be cut at the first null byte.
It can be converted to a Rust String if it is UTF8 encoded.
Implementations§
Trait Implementations§
Source§impl<const LEN: usize> AsBytes for String<LEN>
impl<const LEN: usize> AsBytes for String<LEN>
Source§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
Gets the bytes of this value mutably. Read more
Source§fn write_to_prefix<B>(&self, bytes: B) -> Option<()>where
B: ByteSliceMut,
fn write_to_prefix<B>(&self, bytes: B) -> Option<()>where
B: ByteSliceMut,
Source§fn write_to_suffix<B>(&self, bytes: B) -> Option<()>where
B: ByteSliceMut,
fn write_to_suffix<B>(&self, bytes: B) -> Option<()>where
B: ByteSliceMut,
impl<const LEN: usize> Copy for String<LEN>
Source§impl<const LEN: usize> FromBytes for String<LEN>
impl<const LEN: usize> FromBytes for String<LEN>
Auto Trait Implementations§
impl<const LEN: usize> Freeze for String<LEN>
impl<const LEN: usize> RefUnwindSafe for String<LEN>
impl<const LEN: usize> Send for String<LEN>
impl<const LEN: usize> Sync for String<LEN>
impl<const LEN: usize> Unpin for String<LEN>
impl<const LEN: usize> UnsafeUnpin for String<LEN>
impl<const LEN: usize> UnwindSafe for String<LEN>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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