pub enum StrLen {
LengthPrefixed,
NullTerminated,
NullTerminatedFixed(usize),
}Expand description
The encoding method use for the length of a string.
Variants§
LengthPrefixed
The length of the string is stored before its contents as an usize.
NullTerminated
The length of the string is obtained by finding the first occurrence of n
number of null bytes, where n is the length in bytes of one code unit for
the given string encoding (see StrEncoding::bytes).
NullTerminatedFixed(usize)
Like StrLen::NullTerminated, but the string always occupies n bytes,
where the last bytes are filled with null-bytes if the length of the string after
being encoded is less than n bytes.
Trait Implementations§
impl Copy for StrLen
impl Eq for StrLen
impl StructuralPartialEq for StrLen
Auto Trait Implementations§
impl Freeze for StrLen
impl RefUnwindSafe for StrLen
impl Send for StrLen
impl Sync for StrLen
impl Unpin for StrLen
impl UnwindSafe for StrLen
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