Struct coord::coord::antichain::AntichainToken [−][src]
pub struct AntichainToken<T: PartialOrder + Ord + Clone> {
antichain: MutableAntichain<T>,
changes: Rc<RefCell<ChangeBatch<T>>>,
action: Rc<RefCell<dyn FnMut(Drain<'_, (T, i64)>)>>,
}
Expand description
A token that holds a mutable antichain and invokes an action should it change.
Fields
antichain: MutableAntichain<T>
changes: Rc<RefCell<ChangeBatch<T>>>
action: Rc<RefCell<dyn FnMut(Drain<'_, (T, i64)>)>>
Implementations
Creates a new token.
Advance the frontier of the mutable antichain to frontier
, if frontier
is
ahead of the current frontier.
This function intentionally does not assert that frontier
will necessarily
be in advance of the current frontier because some uses in the Coordinator don’t
work well with that. Specifically, in the Coordinator its possible for a since
frontier to be ahead of the upper
frontier for an index, and changes to the
upper
frontier cause the Coordinator to want to “advance” the since
to
new_upper - logical_compaction_window
which might not be in advance of the
existing since
frontier.
TODO: can we remove maybe_advance
and replace with a stricter advace
that
requires callers to present incresing frontiers?
Methods from Deref<Target = MutableAntichain<T>>
Reveals the minimal elements with positive count.
Examples
use timely::progress::frontier::MutableAntichain;
let mut frontier = MutableAntichain::<usize>::new();
assert!(frontier.frontier().len() == 0);
Returns true if there are no elements in the MutableAntichain
.
Examples
use timely::progress::frontier::MutableAntichain;
let mut frontier = MutableAntichain::<usize>::new();
assert!(frontier.is_empty());
Returns true if any item in the MutableAntichain
is strictly less than the argument.
Examples
use timely::progress::frontier::MutableAntichain;
let mut frontier = MutableAntichain::new_bottom(1u64);
assert!(!frontier.less_than(&0));
assert!(!frontier.less_than(&1));
assert!(frontier.less_than(&2));
Returns true if any item in the MutableAntichain
is less than or equal to the argument.
Examples
use timely::progress::frontier::MutableAntichain;
let mut frontier = MutableAntichain::new_bottom(1u64);
assert!(!frontier.less_equal(&0));
assert!(frontier.less_equal(&1));
assert!(frontier.less_equal(&2));
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for AntichainToken<T>
impl<T> !Send for AntichainToken<T>
impl<T> !Sync for AntichainToken<T>
impl<T> Unpin for AntichainToken<T> where
T: Unpin,
impl<T> !UnwindSafe for AntichainToken<T>
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more