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 Graphwhere
*const LeafNode<String, Node> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Node)>>: Freeze,
*const LeafNode<String, Edge> is !null: Freeze,
PhantomData<Box<(String, Edge)>>: Freeze,
*const LeafNode<String, SetValZST> is !null: Freeze,
PhantomData<Box<(String, SetValZST)>>: Freeze,
*const LeafNode<String, Purge> is !null: Freeze,
PhantomData<Box<(String, Purge)>>: Freeze,
*const LeafNode<(String, u64), SetValZST> is !null: Freeze,
PhantomData<Box<((String, u64), SetValZST)>>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
impl Move for Graph
impl RefUnwindSafe for Graph
impl Send for Graphwhere
NodeRef<Owned, String, Node, LeafOrInternal>: Send,
BoxRaw<(String, Node)>: Send,
NodeRef<Owned, String, Edge, LeafOrInternal>: Send,
BoxRaw<(String, Edge)>: Send,
NodeRef<Owned, String, SetValZST, LeafOrInternal>: Send,
BoxRaw<(String, SetValZST)>: Send,
NodeRef<Owned, String, Purge, LeafOrInternal>: Send,
BoxRaw<(String, Purge)>: Send,
NodeRef<Owned, (String, u64), SetValZST, LeafOrInternal>: Send,
BoxRaw<((String, u64), SetValZST)>: Send,
NodeRef<Owned, String, String, LeafOrInternal>: Send,
BoxRaw<(String, String)>: Send,
impl Sync for Graphwhere
NodeRef<Owned, String, Node, LeafOrInternal>: Sync,
BoxRaw<(String, Node)>: Sync,
NodeRef<Owned, String, Edge, LeafOrInternal>: Sync,
BoxRaw<(String, Edge)>: Sync,
NodeRef<Owned, String, SetValZST, LeafOrInternal>: Sync,
BoxRaw<(String, SetValZST)>: Sync,
NodeRef<Owned, String, Purge, LeafOrInternal>: Sync,
BoxRaw<(String, Purge)>: Sync,
NodeRef<Owned, (String, u64), SetValZST, LeafOrInternal>: Sync,
BoxRaw<((String, u64), SetValZST)>: Sync,
NodeRef<Owned, String, String, LeafOrInternal>: Sync,
BoxRaw<(String, String)>: Sync,
impl Unpin for Graphwhere
*const LeafNode<String, Node> is !null: Unpin,
Box<(String, Node)>: Unpin,
*const LeafNode<String, Edge> is !null: Unpin,
Box<(String, Edge)>: Unpin,
*const LeafNode<String, SetValZST> is !null: Unpin,
Box<(String, SetValZST)>: Unpin,
*const LeafNode<String, Purge> is !null: Unpin,
Box<(String, Purge)>: Unpin,
*const LeafNode<(String, u64), SetValZST> is !null: Unpin,
Box<((String, u64), SetValZST)>: Unpin,
*const LeafNode<String, String> is !null: Unpin,
Box<(String, String)>: Unpin,
impl UnsafeUnpin for Graphwhere
*const LeafNode<String, Node> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Node)>>: UnsafeUnpin,
*const LeafNode<String, Edge> is !null: UnsafeUnpin,
PhantomData<Box<(String, Edge)>>: UnsafeUnpin,
*const LeafNode<String, SetValZST> is !null: UnsafeUnpin,
PhantomData<Box<(String, SetValZST)>>: UnsafeUnpin,
*const LeafNode<String, Purge> is !null: UnsafeUnpin,
PhantomData<Box<(String, Purge)>>: UnsafeUnpin,
*const LeafNode<(String, u64), SetValZST> is !null: UnsafeUnpin,
PhantomData<Box<((String, u64), SetValZST)>>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
impl UnwindSafe for Graphwhere
BTreeMap<String, Node>: UnwindSafe,
BTreeMap<String, Edge>: UnwindSafe,
BTreeMap<String, SetValZST>: UnwindSafe,
BTreeMap<String, Purge>: UnwindSafe,
BTreeMap<(String, u64), SetValZST>: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
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