#[non_exhaustive]pub enum StringLayout {
FixedLength {
size: usize,
allow_no_null: bool,
},
LengthPrefix(Size),
ZeroEnded,
}
Expand description
Supported string binary layouts.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
FixedLength
Fixed length string.
Output will be padded by null
characters.
Fields
LengthPrefix(Size)
String is prefixed by length value (Pascal-like).
ZeroEnded
String is null
-ended (C-like).
Implementations§
Source§impl StringLayout
impl StringLayout
Sourcepub const fn fixed_length(size: usize) -> Self
pub const fn fixed_length(size: usize) -> Self
Construct fixed length layout with given size and no null
allowed.
Trait Implementations§
Source§impl Clone for StringLayout
impl Clone for StringLayout
Source§fn clone(&self) -> StringLayout
fn clone(&self) -> StringLayout
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 Debug for StringLayout
impl Debug for StringLayout
impl Copy for StringLayout
Auto Trait Implementations§
impl Freeze for StringLayout
impl RefUnwindSafe for StringLayout
impl Send for StringLayout
impl Sync for StringLayout
impl Unpin for StringLayout
impl UnwindSafe for StringLayout
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