differential_dataflow::trace

Trait Trace

Source
pub trait Trace: TraceReader
where <Self as TraceReader>::Batch: Batch,
{ type Batcher: Batcher<Time = Self::Time>; type Builder: Builder<Input = <Self::Batcher as Batcher>::Output, Time = Self::Time, Output = Self::Batch>; // Required methods fn new( info: OperatorInfo, logging: Option<Logger>, activator: Option<Activator>, ) -> Self; fn exert(&mut self); fn set_exert_logic(&mut self, logic: ExertionLogic); fn insert(&mut self, batch: Self::Batch); fn close(&mut self); }
Expand description

An append-only collection of (key, val, time, diff) tuples.

The trace must pretend to look like a collection of (Key, Val, Time, isize) tuples, but is permitted to introduce new types KeyRef, ValRef, and TimeRef which can be dereference to the types above.

The trace must be constructable from, and navigable by the Key, Val, Time types, but does not need to return them.

Required Associated Types§

Source

type Batcher: Batcher<Time = Self::Time>

A type used to assemble batches from disordered updates.

Source

type Builder: Builder<Input = <Self::Batcher as Batcher>::Output, Time = Self::Time, Output = Self::Batch>

A type used to assemble batches from ordered update sequences.

Required Methods§

Source

fn new( info: OperatorInfo, logging: Option<Logger>, activator: Option<Activator>, ) -> Self

Allocates a new empty trace.

Source

fn exert(&mut self)

Exert merge effort, even without updates.

Source

fn set_exert_logic(&mut self, logic: ExertionLogic)

Sets the logic for exertion in the absence of updates.

The function receives an iterator over batch levels, from large to small, as triples (level, count, length), indicating the level, the number of batches, and their total length in updates. It should return a number of updates to perform, or None if no work is required.

Source

fn insert(&mut self, batch: Self::Batch)

Introduces a batch of updates to the trace.

Batches describe the time intervals they contain, and they should be added to the trace in contiguous intervals. If a batch arrives with a lower bound that does not equal the upper bound of the most recent addition, the trace will add an empty batch. It is an error to then try to populate that region of time.

This restriction could be relaxed, especially if we discover ways in which batch interval order could commute. For now, the trace should complain, to the extent that it cares about contiguous intervals.

Source

fn close(&mut self)

Introduces an empty batch concluding the trace.

This method should be logically equivalent to introducing an empty batch whose lower frontier equals the upper frontier of the most recently introduced batch, and whose upper frontier is empty.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<B, BA, BU> Trace for Spine<B, BA, BU>
where B: Batch + Clone + 'static, BA: Batcher<Time = B::Time>, BU: Builder<Input = BA::Output, Time = BA::Time, Output = B>,

Source§

type Batcher = BA

Source§

type Builder = BU