pub enum SharedValue {
Nil,
Bool(bool),
Long(i64),
Double(f64),
Char(char),
Uuid(u128),
Str(Arc<str>),
Keyword(StaticGcPtr<Keyword>),
Symbol(StaticGcPtr<Symbol>),
ByteBlob(Arc<[u8]>),
}Expand description
A Send + Sync value representation for cross-isolate sharing.
Covers a carefully chosen subset of Value: scalars (stored inline),
immutable strings and byte buffers (refcounted via Arc), and interned
keywords/symbols (program-lifetime StaticGcPtr). Anything that holds
isolate-local GcPtrs is excluded.
Cycles are impossible — SharedValue contains no SharedValue references
— so plain Arc refcounting is sufficient and cycle-free.
Variants§
Nil
Bool(bool)
Long(i64)
Double(f64)
Char(char)
Uuid(u128)
Str(Arc<str>)
Immutable interned string slice.
Keyword(StaticGcPtr<Keyword>)
Keyword interned into the global static arena.
Symbol(StaticGcPtr<Symbol>)
Symbol interned into the global static arena.
ByteBlob(Arc<[u8]>)
Large refcounted byte buffer (the BEAM off-heap-binary trick). Shared without copy across the isolate boundary; freed when the last reference is dropped.
Implementations§
Trait Implementations§
Source§fn clone(&self) -> SharedValue
fn clone(&self) -> SharedValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
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