pub struct WString<const LEN: usize>(/* private fields */);Expand description
Represents a fixed-length wide string.
This type can be created from a &[u16] if its length does not
exceed the fixed length. It can be created from a &str if its
length, encoded in UTF16, does not exceed the fixed length.
It can be freely converted from and to a [u16; N] array, and
to a Vec<u16> where it will be cut at the first null.
It can be converted to a Rust String if it is properly UTF16
encoded.
Implementations§
Trait Implementations§
Source§impl<const LEN: usize> AsBytes for WString<LEN>
impl<const LEN: usize> AsBytes for WString<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 WString<LEN>
Source§impl<const LEN: usize> FromBytes for WString<LEN>
impl<const LEN: usize> FromBytes for WString<LEN>
Auto Trait Implementations§
impl<const LEN: usize> Freeze for WString<LEN>
impl<const LEN: usize> RefUnwindSafe for WString<LEN>
impl<const LEN: usize> Send for WString<LEN>
impl<const LEN: usize> Sync for WString<LEN>
impl<const LEN: usize> Unpin for WString<LEN>
impl<const LEN: usize> UnsafeUnpin for WString<LEN>
impl<const LEN: usize> UnwindSafe for WString<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