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§
Provided Methods§
Sourcefn resident_value(&self, _index: u64) -> Option<&Value>
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.
Sourcefn read_with_control(
&self,
index: u64,
control: &ProductionControl<'_>,
) -> Result<Produced<Value>, SQLError>
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.
Sourcefn observe_allocations<'a>(
&'a self,
_observer: &mut AllocationObserver<'a, '_>,
) -> Result<(), ValueRetentionError>
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".