Skip to main content

ConstantValueSource

Trait ConstantValueSource 

Source
pub trait ConstantValueSource:
    Debug
    + Send
    + Sync {
    // Required method
    fn read(&self, index: u64) -> Result<Value, SQLError>;

    // Provided methods
    fn resident_value(&self, _index: u64) -> Option<&Value> { ... }
    fn read_with_control(
        &self,
        index: u64,
        control: &ProductionControl<'_>,
    ) -> Result<Produced<Value>, SQLError> { ... }
    fn observe_allocations<'a>(
        &'a self,
        _observer: &mut AllocationObserver<'a, '_>,
    ) -> Result<(), ValueRetentionError> { ... }
}
Expand description

Storage for an already evaluated value. Reading must reproduce the original value without invoking SQL or changing it; implementations own their resource until the final shared handle is dropped.

Required Methods§

Source

fn read(&self, index: u64) -> Result<Value, SQLError>

Provided Methods§

Source

fn resident_value(&self, _index: u64) -> Option<&Value>

Borrow a resident immutable value when its owner exposes one. This never reads or decodes a spill record.

Source

fn read_with_control( &self, index: u64, control: &ProductionControl<'_>, ) -> Result<Produced<Value>, SQLError>

External providers retain their completed output at this boundary. Built-in storage overrides this method to admit decoding before allocation.

Source

fn observe_allocations<'a>( &'a self, _observer: &mut AllocationObserver<'a, '_>, ) -> Result<(), ValueRetentionError>

Observe resident owner storage without decoding a constant or touching its spill files. External providers may have no exposed allocation observation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ConstantValueSource for Produced<Value>

Source§

fn resident_value(&self, index: u64) -> Option<&Value>

Source§

fn read(&self, index: u64) -> Result<Value, SQLError>

Source§

fn observe_allocations<'a>( &'a self, observer: &mut AllocationObserver<'a, '_>, ) -> Result<(), ValueRetentionError>

Implementors§