pub struct SharedNavigationMemory { /* private fields */ }Expand description
The graph’s whole navigation history: one shared visit space, one owner per
node. Methods key by node Uuid; an absent owner reads as empty history and
is created lazily on the node’s first record_visit (or
eagerly via spawn for an anchored branch).
Implementations§
pub fn empty() -> Self
Sourcepub fn from_snapshot(
snapshot: StemmaSnapshot<String, String, NodeHistoryOwner, ()>,
) -> Self
pub fn from_snapshot( snapshot: StemmaSnapshot<String, String, NodeHistoryOwner, ()>, ) -> Self
Wrap an existing snapshot (snapshot restore).
Sourcepub fn snapshot(&self) -> &StemmaSnapshot<String, String, NodeHistoryOwner, ()>
pub fn snapshot(&self) -> &StemmaSnapshot<String, String, NodeHistoryOwner, ()>
The serializable snapshot, for persistence.
pub fn owner_count(&self) -> usize
pub fn entry_count(&self) -> usize
pub fn visit_count(&self) -> usize
Sourcepub fn ensure(&mut self, node: Uuid)
pub fn ensure(&mut self, node: Uuid)
Ensure node has an owner (no creator — a root history). Lazy: also done
by [record_visit]; explicit calls are harmless (idempotent).
Sourcepub fn spawn(&mut self, child: Uuid, parent: Uuid)
pub fn spawn(&mut self, child: Uuid, parent: Uuid)
Spawn child’s owner anchored under parent’s current visit (the
navigated-from point), via node-lineage’s creator machinery. Call before
the child’s first [record_visit] so that first visit attaches under the
parent’s current visit in the shared tree. A no-op-ish fallback to a root
owner if parent has no owner yet.
Sourcepub fn record_visit(
&mut self,
node: Uuid,
url: &str,
transition: MemoryTransitionKind,
at_ms: u64,
)
pub fn record_visit( &mut self, node: Uuid, url: &str, transition: MemoryTransitionKind, at_ms: u64, )
Record navigating node to url as a new current visit. Forward-fork:
navigating after back branches off the current visit and
preserves the prior forward path. Entries dedup by URL; each navigation is
a distinct visit. Creates the owner (root) if absent.
Sourcepub fn back(&mut self, node: Uuid, at_ms: u64) -> Option<String>
pub fn back(&mut self, node: Uuid, at_ms: u64) -> Option<String>
Move node’s cursor back one visit. Returns the revealed URL, or None at
the root (cursor did not move).
Sourcepub fn forward(&mut self, node: Uuid, at_ms: u64) -> Option<String>
pub fn forward(&mut self, node: Uuid, at_ms: u64) -> Option<String>
Move node’s cursor forward one visit. Returns the revealed URL, or None
at the tip.
Sourcepub fn projection(&self, node: Uuid) -> NodeHistoryProjection
pub fn projection(&self, node: Uuid) -> NodeHistoryProjection
node’s linear-history projection (active path + cursor).
Sourcepub fn branch_projection(&self, node: Uuid) -> NodeHistoryBranchProjection
pub fn branch_projection(&self, node: Uuid) -> NodeHistoryBranchProjection
node’s branching-history projection (visit tree with alternates).
Sourcepub fn semantic_summary(&self, node: Uuid) -> NodeHistorySemanticSummary
pub fn semantic_summary(&self, node: Uuid) -> NodeHistorySemanticSummary
A coarse semantic summary of node’s history, for intelligence layers.
Sourcepub fn recent_visited(&self, limit: usize) -> Vec<RecentVisit>
pub fn recent_visited(&self, limit: usize) -> Vec<RecentVisit>
The graph’s recently-visited nodes, newest first, capped at limit. A pure
projection over the one shared visit space (R0 shared-projection): each node
(owner) contributes the url + timestamp of its latest visit; nodes never
navigated are omitted. This is the graph-wide “recent” the forest composes
into — no separate recency list. (gloss recent-nodes; the lineage pane.)
Sourcepub fn current_url(&self, node: Uuid) -> Option<String>
pub fn current_url(&self, node: Uuid) -> Option<String>
node’s current page (its cursor’s URL), if any.
Sourcepub fn can_forward(&self, node: Uuid) -> bool
pub fn can_forward(&self, node: Uuid) -> bool
Whether forward would move node’s cursor.
Trait Implementations§
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§type Archived = ArchivedSharedNavigationMemory
type Archived = ArchivedSharedNavigationMemory
Source§type Resolver = SharedNavigationMemoryResolver
type Resolver = SharedNavigationMemoryResolver
Source§fn clone(&self) -> SharedNavigationMemory
fn clone(&self) -> SharedNavigationMemory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<SharedNavigationMemory, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<SharedNavigationMemory, <__D as Fallible>::Error>
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MemoryPayload for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.