Skip to main content

HeapValue

Enum HeapValue 

Source
pub enum HeapValue {
Show 66 variants String(Arc<String>), Array(VMArray), Decimal(Decimal), BigInt(i64), HostClosure(HostCallable), DataTable(Arc<DataTable>), HashMap(Box<HashMapData>), Set(Box<SetData>), Deque(Box<DequeData>), PriorityQueue(Box<PriorityQueueData>), Content(Box<ContentNode>), Instant(Box<Instant>), IoHandle(Box<IoHandleData>), Enum(Box<EnumValue>), Some(Box<ValueWord>), Ok(Box<ValueWord>), Err(Box<ValueWord>), Future(u64), ExprProxy(Arc<String>), FilterExpr(Arc<FilterNode>), Time(DateTime<FixedOffset>), Duration(Duration), TimeSpan(Duration), Timeframe(Timeframe), TimeReference(Box<TimeReference>), DateTimeExpr(Box<DateTimeExpr>), DataDateTimeRef(Box<DataDateTimeRef>), TypeAnnotation(Box<TypeAnnotation>), PrintResult(Box<PrintResult>), SimulationCall(Box<SimulationCallData>), DataReference(Box<DataReferenceData>), NativeScalar(NativeScalar), NativeView(Box<NativeViewData>), IntArray(Arc<TypedBuffer<i64>>), FloatArray(Arc<AlignedTypedBuffer>), BoolArray(Arc<TypedBuffer<u8>>), Matrix(Arc<MatrixData>), I8Array(Arc<TypedBuffer<i8>>), I16Array(Arc<TypedBuffer<i16>>), I32Array(Arc<TypedBuffer<i32>>), U8Array(Arc<TypedBuffer<u8>>), U16Array(Arc<TypedBuffer<u16>>), U32Array(Arc<TypedBuffer<u32>>), U64Array(Arc<TypedBuffer<u64>>), F32Array(Arc<TypedBuffer<f32>>), Iterator(Box<IteratorState>), Generator(Box<GeneratorState>), Mutex(Box<MutexData>), Atomic(Box<AtomicData>), Lazy(Box<LazyData>), Channel(Box<ChannelData>), Char(char), ProjectedRef(Box<ProjectedRefData>), FloatArraySlice { parent: Arc<MatrixData>, offset: u32, len: u32, }, TypedObject { schema_id: u64, slots: Box<[ValueSlot]>, heap_mask: u64, }, Closure { function_id: u16, upvalues: Vec<Upvalue>, }, TypedTable { schema_id: u64, table: Arc<DataTable>, }, RowView { schema_id: u64, table: Arc<DataTable>, row_idx: usize, }, ColumnRef { schema_id: u64, table: Arc<DataTable>, col_id: u32, }, IndexedTable { schema_id: u64, table: Arc<DataTable>, index_col: u32, }, Range { start: Option<Box<ValueWord>>, end: Option<Box<ValueWord>>, inclusive: bool, }, TaskGroup { kind: u8, task_ids: Vec<u64>, }, TraitObject { value: Box<ValueWord>, vtable: Arc<VTable>, }, TypeAnnotatedValue { type_name: String, value: Box<ValueWord>, }, FunctionRef { name: String, closure: Option<Box<ValueWord>>, }, SharedCell(Arc<RwLock<ValueWord>>),
}
Expand description

Compact heap-allocated value for ValueWord TAG_HEAP.

Every type that cannot be inlined in ValueWord has a dedicated variant here. Inline ValueWord types (f64, i48, bool, None, Unit, Function, ModuleFunction) are never stored in HeapValue.

Variants§

§

String(Arc<String>)

§

Array(VMArray)

§

Decimal(Decimal)

§

BigInt(i64)

§

HostClosure(HostCallable)

§

DataTable(Arc<DataTable>)

§

HashMap(Box<HashMapData>)

§

Set(Box<SetData>)

§

Deque(Box<DequeData>)

§

PriorityQueue(Box<PriorityQueueData>)

§

Content(Box<ContentNode>)

§

Instant(Box<Instant>)

§

IoHandle(Box<IoHandleData>)

§

Enum(Box<EnumValue>)

§

Some(Box<ValueWord>)

§

Ok(Box<ValueWord>)

§

Err(Box<ValueWord>)

§

Future(u64)

§

ExprProxy(Arc<String>)

§

FilterExpr(Arc<FilterNode>)

§

Time(DateTime<FixedOffset>)

§

Duration(Duration)

§

TimeSpan(Duration)

§

Timeframe(Timeframe)

§

TimeReference(Box<TimeReference>)

§

DateTimeExpr(Box<DateTimeExpr>)

§

DataDateTimeRef(Box<DataDateTimeRef>)

§

TypeAnnotation(Box<TypeAnnotation>)

§

PrintResult(Box<PrintResult>)

§

SimulationCall(Box<SimulationCallData>)

§

DataReference(Box<DataReferenceData>)

§

NativeScalar(NativeScalar)

§

NativeView(Box<NativeViewData>)

§

IntArray(Arc<TypedBuffer<i64>>)

§

FloatArray(Arc<AlignedTypedBuffer>)

§

BoolArray(Arc<TypedBuffer<u8>>)

§

Matrix(Arc<MatrixData>)

§

I8Array(Arc<TypedBuffer<i8>>)

§

I16Array(Arc<TypedBuffer<i16>>)

§

I32Array(Arc<TypedBuffer<i32>>)

§

U8Array(Arc<TypedBuffer<u8>>)

§

U16Array(Arc<TypedBuffer<u16>>)

§

U32Array(Arc<TypedBuffer<u32>>)

§

U64Array(Arc<TypedBuffer<u64>>)

§

F32Array(Arc<TypedBuffer<f32>>)

§

Iterator(Box<IteratorState>)

§

Generator(Box<GeneratorState>)

§

Mutex(Box<MutexData>)

§

Atomic(Box<AtomicData>)

§

Lazy(Box<LazyData>)

§

Channel(Box<ChannelData>)

§

Char(char)

§

ProjectedRef(Box<ProjectedRefData>)

§

FloatArraySlice

Zero-copy read-only slice into a parent matrix row.

Fields

§parent: Arc<MatrixData>
§offset: u32
§len: u32
§

TypedObject

Fields

§schema_id: u64
§slots: Box<[ValueSlot]>
§heap_mask: u64
§

Closure

Fields

§function_id: u16
§upvalues: Vec<Upvalue>
§

TypedTable

Fields

§schema_id: u64
§

RowView

Fields

§schema_id: u64
§row_idx: usize
§

ColumnRef

Fields

§schema_id: u64
§col_id: u32
§

IndexedTable

Fields

§schema_id: u64
§index_col: u32
§

Range

Fields

§inclusive: bool
§

TaskGroup

Fields

§kind: u8
§task_ids: Vec<u64>
§

TraitObject

Fields

§vtable: Arc<VTable>
§

TypeAnnotatedValue

Fields

§type_name: String
§

FunctionRef

Fields

§name: String
§

SharedCell(Arc<RwLock<ValueWord>>)

Implementations§

Source§

impl HeapValue

Source

pub fn kind(&self) -> HeapKind

Get the kind discriminator for fast dispatch without full pattern matching.

Source

pub fn is_truthy(&self) -> bool

Check if this heap value is truthy.

Source

pub fn type_name(&self) -> &'static str

Get the type name for this heap value.

Source§

impl HeapValue

Source

pub fn structural_eq(&self, other: &HeapValue) -> bool

Structural equality comparison for HeapValue.

Used by ValueWord::PartialEq when two heap-tagged values have different Arc pointers but may contain equal data.

Source

pub fn equals(&self, other: &HeapValue) -> bool

Check equality between two heap values.

Trait Implementations§

Source§

impl Clone for HeapValue

Source§

fn clone(&self) -> HeapValue

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for HeapValue

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, 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.