pub struct Graph {
pub nodes: BTreeMap<String, Node>,
pub edges: BTreeMap<String, Edge>,
pub purged_events: BTreeSet<String>,
pub purged_nodes: BTreeMap<String, Purge>,
pub tombstones: BTreeSet<(String, u64)>,
pub added_by: BTreeMap<String, String>,
pub cursor: u64,
}Expand description
The folded graph of a place.
Fields§
§nodes: BTreeMap<String, Node>§edges: BTreeMap<String, Edge>§purged_events: BTreeSet<String>Event ids whose body a purge shredded.
purged_nodes: BTreeMap<String, Purge>Node id → the purge that removed its text.
tombstones: BTreeSet<(String, u64)>Every purge tombstone folded: (purge_id, seq of the tombstone);
each one is acknowledged to the place once (E9).
added_by: BTreeMap<String, String>Event id of every node.add → its node, so a later purge of that
event finds the node.
cursor: u64Highest seq folded.
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn fold(&mut self, events: &[FoldEvent]) -> Result<(), FoldError>
pub fn fold(&mut self, events: &[FoldEvent]) -> Result<(), FoldError>
Fold events (any order) onto this graph. Events at or below the
cursor were folded before and are skipped.
Sourcepub fn live_nodes(&self) -> impl Iterator<Item = (&String, &Node)>
pub fn live_nodes(&self) -> impl Iterator<Item = (&String, &Node)>
Nodes an agent may be given: not retracted, not purged.
Trait Implementations§
impl StructuralPartialEq for Graph
Auto Trait Implementations§
impl Forget for Graph
impl Freeze for Graph
impl Move for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnsafeUnpin for Graph
impl UnwindSafe for Graph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more