pub struct Cursors { /* private fields */ }Expand description
Provenance-driven advancer that targets only the cursor nodes relevant to a specific set of output fields.
Built by a host from the output names it will read, tracing Polydat provenance from those fields back to root cursor nodes. Only those cursors advance — unused cursors are left untouched.
Implementations§
Source§impl Cursors
impl Cursors
Sourcepub fn for_fields(
program: &PolydatProgram,
field_names: &[&str],
source_factories: &HashMap<String, Arc<dyn DataSourceFactory>>,
) -> Self
pub fn for_fields( program: &PolydatProgram, field_names: &[&str], source_factories: &HashMap<String, Arc<dyn DataSourceFactory>>, ) -> Self
Build an advancer from a Polydat program, a set of output field names, and a map of source name → DataSourceFactory.
Traces provenance: for each field, finds the output node, gets its
input provenance bitmask, and identifies which inputs are cursor
ordinals (matching {source}__ordinal pattern). Creates a reader
for each targeted source.
Sourcepub fn reserve_ordinal_batch(
&mut self,
demand: usize,
) -> Result<Option<OrdinalBatchLease>, CursorBatchError>
pub fn reserve_ordinal_batch( &mut self, demand: usize, ) -> Result<Option<OrdinalBatchLease>, CursorBatchError>
Reserve one owned batch from a single perfect ordinal cursor.
This is the source-side entry point for Tier-1 SIMD execution. It is intentionally unavailable for multiple cursor targets or sources that merely happen to be monotonic: only the explicit perfect-ordinal contract permits payload-free replay from the returned range.
Sourcepub fn advance(&mut self) -> bool
pub fn advance(&mut self) -> bool
Advance all targeted cursors. Returns false if any targeted
cursor is exhausted (no more data).
After advancing, the new ordinals and field projections are
available via inject_into_state().
Sourcepub fn inject_into_state(&self, state: &mut PolydatState)
pub fn inject_into_state(&self, state: &mut PolydatState)
Inject the current cursor values into a Polydat state.
Sets each cursor’s ordinal at its input index. Field projections
are not written here; a host reads them from last_items().
Sourcepub fn last_items(&self) -> &[Option<SourceItem>]
pub fn last_items(&self) -> &[Option<SourceItem>]
The last items read from all targets, for a host to project fields from.
Sourcepub fn extent(&self) -> Option<u64>
pub fn extent(&self) -> Option<u64>
Known extent of the driving cursor (smallest among targeted cursors with known extent). Used for progress reporting.
Sourcepub fn target_count(&self) -> usize
pub fn target_count(&self) -> usize
Number of targeted cursors.
Auto Trait Implementations§
impl !RefUnwindSafe for Cursors
impl !Sync for Cursors
impl !UnwindSafe for Cursors
impl Forget for Cursors
impl Freeze for Cursorswhere
*const u8 is !null: Freeze,
PhantomData<CursorTarget>: Freeze,
PhantomData<Option<SourceItem>>: Freeze,
impl Move for Cursors
impl Send for Cursorswhere
RawVecInner: Send,
BoxRaw<dyn DataSource>: Send,
Arc<str>: Send,
Arc<[u8]>: Send,
Arc<Value>: Send,
BoxRaw<dyn ReflectedValue>: Send,
Arc<dyn Any + Send + Sync>: Send,
Arc<OrdinalSet>: Send,
Arc<PredicateForms>: Send,
Arc<RecordForms>: Send,
SliceArc<f32>: Send,
SliceArc<i32>: Send,
SliceArc<f64>: Send,
SliceArc<i64>: Send,
SliceArc<f16>: Send,
SliceArc<i16>: Send,
SliceArc<i8>: Send,
impl Unpin for Cursorswhere
*const u8 is !null: Unpin,
Box<dyn DataSource>: Unpin,
Arc<str>: Unpin,
Arc<[u8]>: Unpin,
Arc<Value>: Unpin,
Box<dyn ReflectedValue>: Unpin,
Arc<dyn Any + Send + Sync>: Unpin,
Arc<OrdinalSet>: Unpin,
Arc<PredicateForms>: Unpin,
Arc<RecordForms>: Unpin,
*const f32: Unpin,
*const i32: Unpin,
*const f64: Unpin,
*const i64: Unpin,
*const f16: Unpin,
*const i16: Unpin,
*const i8: Unpin,
impl UnsafeUnpin for Cursorswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<CursorTarget>: UnsafeUnpin,
PhantomData<Option<SourceItem>>: UnsafeUnpin,
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> 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