pub struct CompiledComprehension { /* private fields */ }Expand description
A comprehension that has been compiled to immutable IR and is ready to dispense. The single source of truth for the underlying program across the consumption surfaces.
Construction is via from_ast (compiles once) or
from_program (when the IR was compiled elsewhere).
Cloning a CompiledComprehension is cheap — just an
Arc::clone on the program.
Implementations§
Source§impl CompiledComprehension
impl CompiledComprehension
Sourcepub fn from_ast(ast: &Comprehension) -> Self
pub fn from_ast(ast: &Comprehension) -> Self
Compile an AST. Performs the AST → IR pass once.
Sourcepub fn from_program(program: Arc<Program>) -> Self
pub fn from_program(program: Arc<Program>) -> Self
Wrap an already-compiled program (the optimizer is the canonical caller; tests use this for hand-built IR).
Sourcepub fn program(&self) -> &Program
pub fn program(&self) -> &Program
Access the underlying compiled program (immutable per spec §9.1).
Sourcepub fn coordinate_stream(&self) -> CoordinateStream ⓘ
pub fn coordinate_stream(&self) -> CoordinateStream ⓘ
First-order surface (spec §9.5).
Return a fresh CoordinateStream. Each call
allocates new per-streamer state; siblings share the
underlying IR but dispense independently per spec
§9.5.2’s independence contract.
Sourcepub fn scoped_kernel_stream<K: KernelScope>(
&self,
parent: K,
) -> ScopedKernelStream<K> ⓘ
pub fn scoped_kernel_stream<K: KernelScope>( &self, parent: K, ) -> ScopedKernelStream<K> ⓘ
Second-order surface (spec §9.5).
Return a fresh ScopedKernelStream wrapping the
supplied parent kernel. Each advance() pulls one
coord tuple from the underlying IR and applies
parent.scope(&coords) to produce a
ScopedKernelInstance.
Independence: pulling from this stream does NOT
advance any CoordinateStream obtained from the
same CompiledComprehension.
Sourcepub fn scope_once<K: KernelScope>(
&self,
parent: &K,
coords: &Tuple,
) -> ScopedKernelInstance<K::Scoped>
pub fn scope_once<K: KernelScope>( &self, parent: &K, coords: &Tuple, ) -> ScopedKernelInstance<K::Scoped>
One-shot surface (spec §9.5.3).
Apply parent.scope(coords) directly, without
constructing any streamer. Pure function — no
cursor consulted, no dispense state advanced. Used
for replay, debugging, and point queries where a
specific coord tuple is already known.
Trait Implementations§
Source§impl Clone for CompiledComprehension
impl Clone for CompiledComprehension
Source§fn clone(&self) -> CompiledComprehension
fn clone(&self) -> CompiledComprehension
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CompiledComprehension
impl RefUnwindSafe for CompiledComprehension
impl Send for CompiledComprehension
impl Sync for CompiledComprehension
impl Unpin for CompiledComprehension
impl UnsafeUnpin for CompiledComprehension
impl UnwindSafe for CompiledComprehension
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more