pub struct CString16(_);
Expand description
Methods from Deref<Target = CStr16>
Converts this C string to a u16 slice
Converts this C string to a u16 slice containing the trailing 0 char
Get the number of bytes in the string (including the trailing null character).
Writes each Char16
as a [´char´] (4 bytes long in Rust language) into the buffer.
It is up the the implementer of core::fmt::Write
to convert the char to a string
with proper encoding/charset. For example, in the case of alloc::string::String
all Rust chars (UTF-32) get converted to UTF-8.
Example
let firmware_vendor_c16_str: CStr16 = ...;
// crate "arrayvec" uses stack-allocated arrays for Strings => no heap allocations
let mut buf = arrayvec::ArrayString::<128>::new();
firmware_vendor_c16_str.as_str_in_buf(&mut buf);
log::info!("as rust str: {}", buf.as_str());
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for CString16
impl UnwindSafe for CString16
Blanket Implementations
Mutably borrows from an owned value. Read more