mod epoch

module epoch

Structs and Unions

struct Epoch

The basic unit of event alignment in Noob: Events emitted within the same epoch are passed to a node’s slots together.

Epochs are hierarchical: by default, all events exist in an integer-valued root epoch. However if a node like Map expands cardinality by emitting multiple events per event taken in, Epochs grow “layers” of subepochs labeled with the ID of the node that emitted them.

root: u32

The common, tube-level epoch

path: Vec<EpochSegment>

Subepoch segments induced by cardinality expanding Maplike events.

Implementations

impl Epoch

Functions

fn child(mut self, subep: EpochSegment) -> Epoch
fn is_root(&self) -> bool
fn leaf(&self) -> Option<&EpochSegment>

The last available subepoch segment, if any. None for root epochs.

fn make_subepochs(&self, node: ItemID, n: u32) -> Vec<Epoch>

Create a collection of n sequential subepochs induced by events from the given node

Example

# use noob_core::epoch::Epoch;
let subeps = Epoch::from(0).make_subepochs(6, 2);
println!("{subeps:?}");
// vec![Epoch(0) / (6, 0), Epoch(0) / (6, 1)]
fn n_segments(&self) -> usize

1 for root epochs, 1 + subepoch segments otherwise.

fn new(root: u32, path: impl IntoIterator<Item = impl Into<EpochSegment>>) -> Epoch
fn parent(&self) -> Option<Epoch>
fn parents(&self) -> impl Iterator<Item = Epoch> + '_
fn root(&self) -> u32
fn segments(&self) -> impl Iterator<Item = EpochSegment> + '_
impl Epoch

Traits implemented

impl From<u32> for Epoch
# use noob_core::epoch::Epoch;
Epoch::from(0);
impl<T: Into<EpochSegment>> Div<T> for Epoch
# use noob_core::epoch::{Epoch, EpochSegment};
let ep = Epoch::from(0) / (1, 2);
println!("{}", ep);
let ep = Epoch::from(0) / EpochSegment{ node: 1, epoch: 2 };
println!("{}", ep);
impl Add<u32> for Epoch

Increment the lowest layer of the epoch.

Examples:

# use noob_core::epoch::Epoch;
let ep = Epoch::from(0) + 1;
println!("{}", ep);
// Epoch(1)

let child = Epoch::from(0) / (2, 3);
let child = child + 1;
println!("{}", child);
// Epoch(1, (2, 4))
impl Sub<u32> for Epoch

Decrement the lowest layer of the epoch.

Examples:

# use noob_core::epoch::Epoch;
let ep = Epoch::from(1) - 1;
println!("{}", ep);
// Epoch(0)
let ep = (Epoch::from(0) / (2, 3)) - 1;
println!("{}", ep);
// Epoch(1, (2, 2))
impl fmt::Display for Epoch
struct EpochSegment

A single layer of a subepoch

node: ItemID

The node that created this layer of the subepoch

epoch: u32

The index of this subepoch within its layer

Traits implemented

impl From<(ItemID, u32)> for EpochSegment
impl fmt::Display for EpochSegment

Takes the interner arc lock - don’t be string formatting while mutating interns