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
Mapexpands 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.
Nonefor root epochs.
- fn make_subepochs(&self, node: ItemID, n: u32) -> Vec<Epoch>¶
Create a collection of
nsequential subepochs induced by events from the given nodeExample
# 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 root(&self) -> u32¶
- fn segments(&self) -> impl Iterator<Item = EpochSegment> + '_¶
Traits implemented
- 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))
- struct EpochSegment¶
A single layer of a 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