#[repr(C)]pub struct StringObj {
pub header: HeapHeader,
pub data: *const u8,
pub len: u32,
pub _pad: u32,
}Expand description
Refcounted, repr(C) string for v2 runtime. Total: 24 bytes (header 8 + data ptr 8 + len 4 + pad 4).
Fields§
§header: HeapHeader§data: *const u8Pointer to UTF-8 bytes. NOT null-terminated.
len: u32Byte length (not char count).
_pad: u32Implementations§
Trait Implementations§
Source§impl HeapElement for StringObj
impl HeapElement for StringObj
Source§unsafe fn release_elem(ptr: *const Self)
unsafe fn release_elem(ptr: *const Self)
Decrement the reference count of
*ptr. If the refcount reaches
zero, fully deallocate the object (including any nested payload
buffers per the implementor’s drop semantics). Read moreAuto Trait Implementations§
impl !Freeze for StringObj
impl RefUnwindSafe for StringObj
impl !Send for StringObj
impl !Sync for StringObj
impl Unpin for StringObj
impl UnsafeUnpin for StringObj
impl UnwindSafe for StringObj
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