pub struct StringLayout {
pub len_offset: usize,
pub data_offset: usize,
pub is_sso: bool,
pub sso_max_len: usize,
pub sso_total_size: usize,
}Expand description
Memory layout for a string object.
OxiLean strings are heap-allocated objects with a reference count header, a length field, and an inline (or pointer-to) UTF-8 byte array.
+--------+---------+--------+---------+----------+
| RC (8) | Tag (1) | Flags | Len (4) | Data ... |
+--------+---------+--------+---------+----------+Fields§
§len_offset: usizeByte offset of the length field.
data_offset: usizeByte offset of the UTF-8 data.
is_sso: boolWhether the string is SSO (short-string optimized / inline).
sso_max_len: usizeMaximum length for SSO strings.
sso_total_size: usizeTotal allocated size for an SSO string (fixed).
Implementations§
Source§impl StringLayout
impl StringLayout
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
Source§impl Display for StringLayout
impl Display for StringLayout
Source§impl PartialEq for StringLayout
impl PartialEq for StringLayout
impl Eq for StringLayout
impl StructuralPartialEq 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 UnsafeUnpin 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