pub struct StringRef {
pub offset: u64,
pub len: u32,
}Expand description
Position-independent reference to a string in a SharedStringArena.
Encoded as a u64 of OFFSET_BITS offset and LEN_BITS length,
for stable cross-process passing: the same u64 resolves to the same
bytes in every process that maps the arena.
The split gives a 1 TiB arena holding strings of up to 16 MiB each. Both are enforced where a ref is minted, so a value that does not fit is refused rather than truncated into a ref that reads someone else’s bytes.
Fields§
§offset: u64§len: u32Implementations§
Trait Implementations§
impl Copy for StringRef
impl Eq for StringRef
impl StructuralPartialEq for StringRef
Auto Trait Implementations§
impl Freeze for StringRef
impl RefUnwindSafe for StringRef
impl Send for StringRef
impl Sync for StringRef
impl Unpin for StringRef
impl UnsafeUnpin for StringRef
impl UnwindSafe for StringRef
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