pub struct Frontier(pub SmallVec<LV, 2>);Expand description
A LocalFrontier is a set of local Time values which point at the set of changes with no
children at this point in time. When there’s a single writer this will always just be the last
local version we’ve seen.
The start of time is named with an empty list.
A frontier must always remain sorted (in numerical order). Note: This is not checked when deserializing via serde!
Tuple Fields§
§0: SmallVec<LV, 2>Implementations§
Source§impl Frontier
impl Frontier
pub fn root() -> Self
pub fn new_1(v: LV) -> Self
pub fn from_unsorted(data: &[LV]) -> Self
pub fn from_unsorted_iter<I: Iterator<Item = LV>>(iter: I) -> Self
pub fn from_sorted(data: &[LV]) -> Self
pub fn is_root(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter<'_, usize>
pub fn try_get_single_entry(&self) -> Option<LV>
pub fn try_get_single_entry_mut(&mut self) -> Option<&mut LV>
pub fn replace(&mut self, with: &'_ [LV])
pub fn debug_check_sorted(&self)
Sourcepub fn advance(&mut self, graph: &Graph, range: DTRange)
pub fn advance(&mut self, graph: &Graph, range: DTRange)
Advance a frontier by the set of time spans in range
Sourcepub fn advance_sparse_known_run(
&mut self,
graph: &Graph,
parents: &[LV],
range: DTRange,
)
pub fn advance_sparse_known_run( &mut self, graph: &Graph, parents: &[LV], range: DTRange, )
Just like advance_by_known_run, the range MUST be in a single transaction in the graph.
Sourcepub fn advance_sparse(&mut self, graph: &Graph, range: DTRange)
pub fn advance_sparse(&mut self, graph: &Graph, range: DTRange)
advance_sparse is used for “sparse” causal graphs, which contain versions for other CRDTs and things. In this case, range might not directly follow the current frontier.
I think this function is equivalent to finding the dominators of self + all txns in range.
Sourcepub fn advance_by_known_run(&mut self, parents: &[LV], span: DTRange)
pub fn advance_by_known_run(&mut self, parents: &[LV], span: DTRange)
Advance branch frontier by a transaction.
This is ONLY VALID if the range is entirely within a txn.
Sourcepub fn merge_union(&mut self, other: &[LV], graph: &Graph)
pub fn merge_union(&mut self, other: &[LV], graph: &Graph)
Replaces self with dominators(self, other).