Skip to main content

SerializedValue

Enum SerializedValue 

Source
pub enum SerializedValue {
Show 38 variants Nil, Bool(bool), Long(i64), Double(f64), BigInt(BigInt), BigDecimal(BigDecimal), Ratio(Ratio<BigInt>), Char(char), Str(String), Uuid(u128), Pattern(String), Symbol { namespace: Option<Arc<str>>, name: Arc<str>, version: Option<Arc<str>>, }, Keyword { namespace: Option<Arc<str>>, name: Arc<str>, }, List(Vec<SerializedValue>), Vector(Vec<SerializedValue>), ArrayMap(Vec<(SerializedValue, SerializedValue)>), HashMap(Vec<(SerializedValue, SerializedValue)>), SortedMap(Vec<(SerializedValue, SerializedValue)>), HashSet(Vec<SerializedValue>), SortedSet(Vec<SerializedValue>), Queue(Vec<SerializedValue>), Cons { head: Box<SerializedValue>, tail: Box<SerializedValue>, }, TypeInstance { type_tag: Arc<str>, fields: Vec<(SerializedValue, SerializedValue)>, }, Error(Box<SerializedError>), BooleanArray(Vec<bool>), ByteArray(Vec<i8>), ShortArray(Vec<i16>), IntArray(Vec<i32>), LongArray(Vec<i64>), FloatArray(Vec<f32>), DoubleArray(Vec<f64>), CharArray(Vec<char>), ObjectArray(Vec<SerializedValue>), WithMeta { value: Box<SerializedValue>, meta: Box<SerializedValue>, }, Reduced(Box<SerializedValue>), SharedAtom(Arc<SharedAtom>), ByteBlob(Arc<[u8]>), Var { namespace: Arc<str>, name: Arc<str>, is_macro: bool, shared_root: Arc<ArcSwap<Option<SharedValue>>>, },
}
Expand description

Send + Sync intermediate form produced by serialize and consumed by deserialize. All heap data is owned (no GcPtr), so it is safe to move across thread boundaries.

Variants§

§

Nil

§

Bool(bool)

§

Long(i64)

§

Double(f64)

§

BigInt(BigInt)

§

BigDecimal(BigDecimal)

§

Ratio(Ratio<BigInt>)

§

Char(char)

§

Str(String)

§

Uuid(u128)

§

Pattern(String)

Regex stored as source string; recompiled on deserialize.

§

Symbol

Fields

§namespace: Option<Arc<str>>
§name: Arc<str>
§version: Option<Arc<str>>
§

Keyword

Fields

§namespace: Option<Arc<str>>
§name: Arc<str>
§

List(Vec<SerializedValue>)

§

Vector(Vec<SerializedValue>)

§

ArrayMap(Vec<(SerializedValue, SerializedValue)>)

§

HashMap(Vec<(SerializedValue, SerializedValue)>)

§

SortedMap(Vec<(SerializedValue, SerializedValue)>)

§

HashSet(Vec<SerializedValue>)

§

SortedSet(Vec<SerializedValue>)

§

Queue(Vec<SerializedValue>)

§

Cons

§

TypeInstance

Fields

§type_tag: Arc<str>
§

Error(Box<SerializedError>)

§

BooleanArray(Vec<bool>)

§

ByteArray(Vec<i8>)

§

ShortArray(Vec<i16>)

§

IntArray(Vec<i32>)

§

LongArray(Vec<i64>)

§

FloatArray(Vec<f32>)

§

DoubleArray(Vec<f64>)

§

CharArray(Vec<char>)

§

ObjectArray(Vec<SerializedValue>)

§

WithMeta

§

Reduced(Box<SerializedValue>)

§

SharedAtom(Arc<SharedAtom>)

SharedAtom is inherently cross-isolate; the Arc is simply cloned so both isolates share the same underlying ArcSwap cell.

§

ByteBlob(Arc<[u8]>)

ByteBlob is an immutable refcounted buffer; clone the Arc.

§

Var

A var crosses by sharing its cross-isolate root cell (the Arc is cloned, so both isolates point at the same ArcSwap). The receiving isolate rebuilds a Var whose local fast-path slot is the demoted current snapshot. Only vars with a promotable (or unbound) root reach here — a non-promotable root is rejected at serialize time.

Fields

§namespace: Arc<str>
§name: Arc<str>
§is_macro: bool

Implementations§

Source§

impl SerializedValue

Source

pub fn byte_size(&self) -> usize

Estimated heap bytes materialized by deep-copying this value into the receiving isolate’s heap. This is an approximation for telemetry (the metered clone seam the isolate-boundary plan requires), not an exact allocation count: each node contributes a fixed per-node cost plus the size of any owned payload (string bytes, array elements, big-number magnitude). Arc-shared payloads (SharedAtom, ByteBlob) count as zero structural bytes because they cross by refcount, not by copy.

Trait Implementations§

Source§

impl Clone for SerializedValue

Source§

fn clone(&self) -> SerializedValue

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SerializedValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more