pub struct Graph { /* private fields */ }Expand description
Main graph structure backed by petgraph::StableGraph
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn table_stats(&self) -> GraphTableStats
pub fn table_stats(&self) -> GraphTableStats
Cheap live counts for the graph’s kernel-owned tables.
Source§impl Graph
impl Graph
Sourcepub fn copy_node_from(
&mut self,
source: &Node,
source_graph: Option<String>,
position: Point2D<f32>,
) -> NodeKey
pub fn copy_node_from( &mut self, source: &Node, source_graph: Option<String>, position: Point2D<f32>, ) -> NodeKey
Copy source’s content into this graph, minting a fresh node and
recording cross-graph derivation provenance back to the source.
source is a donor Node from another Graph; source_graph is the
donor graph’s id (the constellation GraphId rendered as a string), or
None when unknown / same-graph. The copy is a new entity: it gets a
fresh identity, and its content (title, tags, classifications, open
properties, address, visuals, viewer preferences) is cloned, while its
identity / runtime / session / arrangement state is reset (fresh id,
unpinned, no frame hints; browser-runtime state lives in the host’s
BrowserNodeState sidecar and never travels with a copy). A
NodeDerivation records (CopiedFrom, source.id, source_graph) so the
lineage survives and projects to a wasDerivedFrom statement.
The donor’s import_provenance is intentionally not carried over: that
describes how the donor entered its graph from an external source; the
copy’s provenance is the derivation record, not the donor’s import.
Not available on wasm32 (mints a random id, like add_node); use
copy_node_from_with_id with a
host-provided UUID there.
Sourcepub fn copy_node_from_with_id(
&mut self,
id: Uuid,
source: &Node,
source_graph: Option<String>,
_position: Point2D<f32>,
) -> NodeKey
pub fn copy_node_from_with_id( &mut self, id: Uuid, source: &Node, source_graph: Option<String>, _position: Point2D<f32>, ) -> NodeKey
copy_node_from with a caller-supplied id (the
wasm-clean entry point, mirroring
add_node_with_id).
Sourcepub fn copy_node_from_xy(
&mut self,
source: &Node,
source_graph: Option<String>,
x: f32,
y: f32,
) -> NodeKey
pub fn copy_node_from_xy( &mut self, source: &Node, source_graph: Option<String>, x: f32, y: f32, ) -> NodeKey
copy_node_from taking plain x / y screen-graph
coords, so a host can place the copy without depending on euclid. (Tear-out
gestures G5.)
Sourcepub fn copy_component_from(
&mut self,
source: &Graph,
seed: Uuid,
source_graph: Option<String>,
) -> ComponentCopy
pub fn copy_component_from( &mut self, source: &Graph, seed: Uuid, source_graph: Option<String>, ) -> ComponentCopy
Copy the connected component containing seed (a node in source) into this
graph: the kernel half of a tear-out fork (the reachable-subgraph snapshot,
tear-out brief §4.3). The component is component_members’ (every family,
both strata, shown bindings at zero hops; ruling 38), so surfaces joined only by
a resource relation copy together. Each surface is minted fresh (with a
CopiedFrom NodeDerivation back to its source); surface edges among the
copies are re-pointed onto the new nodes by cloning each payload verbatim.
Resources keep their ids (shared content, as selection Copy retains them): the
walked resources and the predicate-declaration resources their content needs
travel as whole records, each copied surface keeps its shown binding, and the
resource edges among them travel verbatim. A resource or resource pair this
graph already holds keeps this graph’s truth. Edges leaving the component are
dropped (the snapshot is closed under the component).
Returns the ComponentCopy: the new keys plus the source id → new id
remap the host’s facet-carry maps donor facets through (G4-R R0 — positions
and every other per-node character ride arrangement.* / web.* / … facets,
not the graph, so the fork’s layout carry needs this mapping).
(Tear-out gestures G4.)
Source§impl Graph
impl Graph
Sourcepub fn try_assert_semantic_statement_by_resource_ids(
&mut self,
from: Uuid,
to: Uuid,
spec: SemanticStatementSpec,
) -> Result<(RelationKey, StatementAssert), StatementWriteError>
pub fn try_assert_semantic_statement_by_resource_ids( &mut self, from: Uuid, to: Uuid, spec: SemanticStatementSpec, ) -> Result<(RelationKey, StatementAssert), StatementWriteError>
Assert over held Resources without creating or selecting a Surface. Held handles keep their recorded placement, even after a nature change.
Sourcepub fn find_semantic_statement(
&self,
statement_id: &str,
) -> Option<(RelationKey, &SemanticStatement)>
pub fn find_semantic_statement( &self, statement_id: &str, ) -> Option<(RelationKey, &SemanticStatement)>
Locate any retained handle, including withdrawn history, independent of
current nature. Use find_held_semantic_statement for default reads.
pub fn find_held_semantic_statement( &self, statement_id: &str, ) -> Option<(RelationKey, &SemanticStatement)>
Sourcepub fn try_assert_semantic_statement(
&mut self,
from: NodeKey,
to: NodeKey,
spec: SemanticStatementSpec,
) -> Result<(RelationKey, StatementAssert), StatementWriteError>
pub fn try_assert_semantic_statement( &mut self, from: NodeKey, to: NodeKey, spec: SemanticStatementSpec, ) -> Result<(RelationKey, StatementAssert), StatementWriteError>
New assertions follow the stored declaration. Reassertions keep their handle’s store. A conflict or missing endpoint returns an error without partial writes.
Sourcepub fn try_import_semantic_statement(
&mut self,
from: NodeKey,
to: NodeKey,
spec: SemanticStatementSpec,
) -> Result<(RelationKey, StatementAssert), StatementWriteError>
pub fn try_import_semantic_statement( &mut self, from: NodeKey, to: NodeKey, spec: SemanticStatementSpec, ) -> Result<(RelationKey, StatementAssert), StatementWriteError>
Import without a carried ID: retain the source time if present, but do not create chronology when the source supplied none. Content ensure keeps repeated imports idempotent until the source provides identity.
Sourcepub fn try_assert_persisted_semantic_statement(
&mut self,
from: NodeKey,
to: NodeKey,
statement: SemanticStatement,
) -> Result<RelationKey, StatementWriteError>
pub fn try_assert_persisted_semantic_statement( &mut self, from: NodeKey, to: NodeKey, statement: SemanticStatement, ) -> Result<RelationKey, StatementWriteError>
Carried handles may update their claim, but cannot select a different claim or store.
Sourcepub fn update_assertion_metadata(
&mut self,
statement_id: &str,
label: Option<String>,
asserted_at_ms: Option<u64>,
) -> bool
pub fn update_assertion_metadata( &mut self, statement_id: &str, label: Option<String>, asserted_at_ms: Option<u64>, ) -> bool
Edit one exact held assertion without selecting a content-key survivor.
Sourcepub fn try_assert_semantic_reason(
&mut self,
from: NodeKey,
to: NodeKey,
spec: SemanticStatementSpec,
) -> Result<(RelationKey, StatementAssert), StatementWriteError>
pub fn try_assert_semantic_reason( &mut self, from: NodeKey, to: NodeKey, spec: SemanticStatementSpec, ) -> Result<(RelationKey, StatementAssert), StatementWriteError>
Ensure an assertion by its L13 reason key. Method version and note may update on the same ID; a changed method IRI or evidence set creates a new independently withdrawable assertion.
Sourcepub fn reconfirm_semantic_assertion(
&mut self,
statement_id: &str,
label: Option<String>,
asserted_at_ms: Option<u64>,
) -> bool
pub fn reconfirm_semantic_assertion( &mut self, statement_id: &str, label: Option<String>, asserted_at_ms: Option<u64>, ) -> bool
Confirm one exact held ID. Missing caller time is stamped once here; an unknown or withdrawn ID is never selected by matching its content.
Sourcepub fn withdraw_semantic_assertion(
&mut self,
statement_id: &str,
at_ms: Option<u64>,
by: Option<String>,
) -> bool
pub fn withdraw_semantic_assertion( &mut self, statement_id: &str, at_ms: Option<u64>, by: Option<String>, ) -> bool
Apply an exact-ID withdrawal. Unknown IDs are explicitly unapplied; callers with causal event streams must defer/reject until admitted.
Sourcepub fn apply_imported_semantic_withdrawal(
&mut self,
statement_id: &str,
at_ms: Option<u64>,
by: Option<String>,
) -> bool
pub fn apply_imported_semantic_withdrawal( &mut self, statement_id: &str, at_ms: Option<u64>, by: Option<String>, ) -> bool
Import/replay path: preserve missing time and never synthesize the clock. It returns false for unknown IDs so an event is not acknowledged.
Sourcepub fn apply_imported_semantic_withdrawal_for_pair(
&mut self,
from: NodeKey,
to: NodeKey,
statement_id: &str,
at_ms: Option<u64>,
by: Option<String>,
) -> bool
pub fn apply_imported_semantic_withdrawal_for_pair( &mut self, from: NodeKey, to: NodeKey, statement_id: &str, at_ms: Option<u64>, by: Option<String>, ) -> bool
Apply an imported exact-ID withdrawal only when its authored pair owns the assertion. Source events with no carried time remain undated.
Sourcepub fn withdraw_semantic_assertion_for_pair(
&mut self,
from: NodeKey,
to: NodeKey,
statement_id: &str,
) -> bool
pub fn withdraw_semantic_assertion_for_pair( &mut self, from: NodeKey, to: NodeKey, statement_id: &str, ) -> bool
Authored pair-checked exact-ID withdrawal. It records the current time and configured writer only after verifying the owning bucket.
Sourcepub fn find_assertion(
&self,
id: &str,
) -> Option<(RelationKey, &SemanticStatement)>
pub fn find_assertion( &self, id: &str, ) -> Option<(RelationKey, &SemanticStatement)>
All-family aliases retain exact owner, ID, basis and lifecycle admission.
pub fn find_held_assertion( &self, id: &str, ) -> Option<(RelationKey, &SemanticStatement)>
pub fn try_assert_relation_statement( &mut self, from: NodeKey, to: NodeKey, spec: SemanticStatementSpec, ) -> Result<(RelationKey, StatementAssert), StatementWriteError>
pub fn try_assert_persisted_relation_statement( &mut self, from: NodeKey, to: NodeKey, statement: SemanticStatement, ) -> Result<RelationKey, StatementWriteError>
Sourcepub fn retract_assertion(&mut self, statement_id: &str) -> bool
pub fn retract_assertion(&mut self, statement_id: &str) -> bool
Compatibility spelling for authored exact-ID withdrawal.
Source§impl Graph
impl Graph
pub fn pending_links(&self) -> &[PendingLink]
pub fn pending_link_state(&self) -> &PendingLinkState
Sourcepub fn retained_pending_link_state(&self) -> PendingLinkState
pub fn retained_pending_link_state(&self) -> PendingLinkState
The durable representation excludes the default session-only entries.
pub fn set_pending_link_retention(&mut self, retention: PendingLinkRetention)
Sourcepub fn restore_pending_link_state(&mut self, state: PendingLinkState)
pub fn restore_pending_link_state(&mut self, state: PendingLinkState)
Install a separate cache slot after truth replay, without deriving claims.
pub fn queue_pending_link(&mut self, link: PendingLink) -> bool
Sourcepub fn purge_pending_links(&mut self) -> usize
pub fn purge_pending_links(&mut self) -> usize
Purging changes no snapshot, source document, assertion or journal entry.
pub fn semantic_observation_revision(&self) -> u64
Sourcepub fn without_pending_derivation<R>(
&mut self,
edit: impl FnOnce(&mut Self) -> R,
) -> R
pub fn without_pending_derivation<R>( &mut self, edit: impl FnOnce(&mut Self) -> R, ) -> R
Suppress ambient extraction through a complete replay or import batch. The previous scope is restored on unwind; clones do not inherit it.
Sourcepub fn retry_pending_links(&mut self) -> PendingLinkRetry
pub fn retry_pending_links(&mut self) -> PendingLinkRetry
Retry only after completed live admission. Recorded assertions remain authoritative: a carried held claim consumes its cache input unchanged.
Source§impl Graph
impl Graph
Sourcepub fn freeze_resource_selection(
&mut self,
spec: Value,
members: Vec<Uuid>,
) -> Result<Uuid, String>
pub fn freeze_resource_selection( &mut self, spec: Value, members: Vec<Uuid>, ) -> Result<Uuid, String>
Mint a Resource that bears a revision-frozen nested graph of references and exact relation copies. Member payloads stay in their owning resources. The spec is opaque to the kernel; the facade supplies its portable value.
Sourcepub fn freeze_resource_selection_with_nonce(
&mut self,
spec: Value,
members: Vec<Uuid>,
nonce: Uuid,
) -> Result<Uuid, String>
pub fn freeze_resource_selection_with_nonce( &mut self, spec: Value, members: Vec<Uuid>, nonce: Uuid, ) -> Result<Uuid, String>
Portable freeze entry point: the host supplies a fresh UUID nonce, as it does for new Surfaces on wasm. A reused address is refused before writing.
Sourcepub fn open_frozen_selection(
&self,
owner: Uuid,
) -> Result<OpenedFrozenSelection<'_>, String>
pub fn open_frozen_selection( &self, owner: Uuid, ) -> Result<OpenedFrozenSelection<'_>, String>
Open the immutable graph without loading or inventing its referenced members.
Source§impl Graph
impl Graph
Sourcepub fn read_link_snapshot(
&self,
stratum: GraphStratum,
first: Uuid,
second: Uuid,
source: FrozenLinkSource,
) -> Result<FrozenLink, String>
pub fn read_link_snapshot( &self, stratum: GraphStratum, first: Uuid, second: Uuid, source: FrozenLinkSource, ) -> Result<FrozenLink, String>
Read a current pair without minting a Resource. An empty pair is a valid reading result for drift comparison, but cannot be frozen.
Sourcepub fn freeze_link_with_nonce(
&mut self,
stratum: GraphStratum,
first: Uuid,
second: Uuid,
source: FrozenLinkSource,
nonce: Uuid,
) -> Result<Uuid, String>
pub fn freeze_link_with_nonce( &mut self, stratum: GraphStratum, first: Uuid, second: Uuid, source: FrozenLinkSource, nonce: Uuid, ) -> Result<Uuid, String>
Freeze a link in one graph stratum as a distinct immutable Resource.
pub fn open_frozen_link( &self, owner: Uuid, ) -> Result<OpenedFrozenLink<'_>, String>
Source§impl Graph
impl Graph
pub fn known_coverage(&self) -> &CoverageNote
Sourcepub fn set_known_coverage(&mut self, note: CoverageNote)
pub fn set_known_coverage(&mut self, note: CoverageNote)
Runtime host context, never graph truth, a journal edit or a geometry key.
pub fn coverage_note(&self) -> CoverageNote
Sourcepub fn coverage_for_resource_refs(&self, references: &[Uuid]) -> CoverageNote
pub fn coverage_for_resource_refs(&self, references: &[Uuid]) -> CoverageNote
Coverage for explicit portable references, without inventing absent records.
pub fn copy_semantic_context_from(&mut self, graph: &Self)
Sourcepub fn clear_semantic_context(&mut self)
pub fn clear_semantic_context(&mut self)
History starts from truth only, never an ambient extraction input.
Source§impl Graph
impl Graph
Sourcepub fn replace_loaded_recorded_snapshot(
&mut self,
snapshot: &GraphSnapshot,
facets: &NodeFacetStore,
coverage: CoverageNote,
) -> Result<(), ResourceSnapshotError>
pub fn replace_loaded_recorded_snapshot( &mut self, snapshot: &GraphSnapshot, facets: &NodeFacetStore, coverage: CoverageNote, ) -> Result<(), ResourceSnapshotError>
Validate the complete candidate before publishing a resident replacement.
Source§impl Graph
impl Graph
pub fn structural_input_key(&self) -> GraphInputKey
pub fn content_input_key(&self) -> GraphInputKey
pub fn url_grouping_input_key(&self) -> GraphInputKey
pub fn visit_input_key(&self) -> GraphInputKey
Source§impl Graph
impl Graph
Sourcepub fn surface_node_lifetime(&self, id: Uuid) -> Option<SurfaceNodeLifetime>
pub fn surface_node_lifetime(&self, id: Uuid) -> Option<SurfaceNodeLifetime>
Observe membership without allocating or changing its life.
Source§impl Graph
impl Graph
pub fn import_records(&self) -> &[ImportRecord]
pub fn import_record_summaries_for_node( &self, key: NodeKey, ) -> Vec<NodeImportRecordSummary>
pub fn import_record_member_keys(&self, record_id: &str) -> Vec<NodeKey> ⓘ
Source§impl Graph
impl Graph
Sourcepub fn facets(&self) -> &NodeFacetStore
pub fn facets(&self) -> &NodeFacetStore
The graph’s single live atomic-facet authority.
Sourcepub fn install_facets(
&mut self,
facets: NodeFacetStore,
) -> Result<(), ResourceSnapshotError>
pub fn install_facets( &mut self, facets: NodeFacetStore, ) -> Result<(), ResourceSnapshotError>
Replace the facet store with facets, a sidecar loaded for this graph.
Refused, with the previous store kept, when the result would fail
checked open: a retained Surface literal may not reuse a handle a
Resource holds ([validate_active_resource_assertion_handles]
(Graph::validate_active_resource_assertion_handles)).
Sourcepub fn overlay_facets(
&mut self,
facets: NodeFacetStore,
) -> Result<(), ResourceSnapshotError>
pub fn overlay_facets( &mut self, facets: NodeFacetStore, ) -> Result<(), ResourceSnapshotError>
Overlay a canonical sidecar after snapshot load.
Legacy snapshot columns are imported while reconstructing the graph.
Existing facets.json values then win for matching keys, while both
stores preserve unrelated namespaces. Checked and kept as
install_facets is.
Source§impl Graph
impl Graph
Insert tags on the shown Resource, retaining each tagger’s assertion.
Sourcepub fn append_node_properties(
&mut self,
key: NodeKey,
incoming: Vec<NodeProperty>,
) -> bool
pub fn append_node_properties( &mut self, key: NodeKey, incoming: Vec<NodeProperty>, ) -> bool
Append literal assertions to the shown Resource in one facet replacement.
Sourcepub fn add_node_classifications(
&mut self,
key: NodeKey,
incoming: Vec<NodeClassification>,
) -> bool
pub fn add_node_classifications( &mut self, key: NodeKey, incoming: Vec<NodeClassification>, ) -> bool
Preserve complete classification variants and the caller’s origin.
Source§impl Graph
impl Graph
Sourcepub fn bear_nested(&mut self, key: NodeKey, nested: Option<LogId>) -> bool
pub fn bear_nested(&mut self, key: NodeKey, nested: Option<LogId>) -> bool
Directly bear (or clear) a nested graph on a node WITHOUT running the
delta spine — for copy/load paths building a graph that has no journal
yet (a fork re-bearing the worlds it carried as real file copies; the
component copy itself deliberately drops nested so two LIVE nodes
never share one world). Journaled edits go through
GraphDelta::SetNodeNested instead.
pub fn frame_layout_hints(&self, key: NodeKey) -> Option<Vec<FrameLayoutHint>>
pub fn frame_split_offer_suppressed(&self, key: NodeKey) -> Option<bool>
pub fn node_is_pinned(&self, key: NodeKey) -> Option<bool>
pub fn node_tag_presentation( &self, key: NodeKey, ) -> Option<NodeTagPresentationState>
pub fn node_import_provenance( &self, key: NodeKey, ) -> Option<Vec<NodeImportProvenance>>
pub fn node_classifications( &self, key: NodeKey, ) -> Option<Vec<NodeClassification>>
Sourcepub fn legacy_node_classifications(
&self,
key: NodeKey,
) -> Option<Vec<NodeClassification>>
pub fn legacy_node_classifications( &self, key: NodeKey, ) -> Option<Vec<NodeClassification>>
Raw retained Surface content, used by legacy replay and RDF compatibility.
pub fn node_properties(&self, key: NodeKey) -> Option<Vec<NodeProperty>>
pub fn legacy_node_properties(&self, key: NodeKey) -> Option<Vec<NodeProperty>>
pub fn node_derivations(&self, key: NodeKey) -> Option<Vec<NodeDerivation>>
Sourcepub fn node_last_visited(&self, key: NodeKey) -> Option<SystemTime>
pub fn node_last_visited(&self, key: NodeKey) -> Option<SystemTime>
When key was last visited: the recency the canvas reads. Not a
projection of the browse trail, which Stemma holds.
pub fn node_last_session_visited(&self, key: NodeKey) -> Option<u64>
Source§impl Graph
impl Graph
Sourcepub fn predicate_declarations(
&self,
predicate: &str,
) -> Result<Option<PredicateDeclarations>, PredicateDeclarationError>
pub fn predicate_declarations( &self, predicate: &str, ) -> Result<Option<PredicateDeclarations>, PredicateDeclarationError>
The declarations held by this mere for one predicate.
Sourcepub fn effective_predicate_stratum(
&self,
predicate: &str,
) -> Result<GraphStratum, PredicateDeclarationError>
pub fn effective_predicate_stratum( &self, predicate: &str, ) -> Result<GraphStratum, PredicateDeclarationError>
Placement for a future assertion; exact historical handles retain their stores.
Sourcepub fn declare_predicate(
&mut self,
predicate: &str,
stratum: GraphStratum,
) -> Result<String, PredicateDeclarationError>
pub fn declare_predicate( &mut self, predicate: &str, stratum: GraphStratum, ) -> Result<String, PredicateDeclarationError>
Retain an authored nature change and explicitly select it for future writes.
Sourcepub fn select_predicate_declaration(
&mut self,
predicate: &str,
declaration_id: &str,
) -> Result<bool, PredicateDeclarationError>
pub fn select_predicate_declaration( &mut self, predicate: &str, declaration_id: &str, ) -> Result<bool, PredicateDeclarationError>
Resolve a retained conflict by exact declaration id, without moving statements.
Source§impl Graph
impl Graph
Sourcepub fn get_relation(&self, key: RelationKey) -> Option<&EdgePayload>
pub fn get_relation(&self, key: RelationKey) -> Option<&EdgePayload>
Read the owning store named by this relation handle.
Sourcepub fn get_resource_edge(&self, key: ResourceEdgeKey) -> Option<&EdgePayload>
pub fn get_resource_edge(&self, key: ResourceEdgeKey) -> Option<&EdgePayload>
Read a resource edge without accepting a surface edge index.
Sourcepub fn find_resource_edge_key(
&self,
from: Uuid,
to: Uuid,
) -> Option<ResourceEdgeKey>
pub fn find_resource_edge_key( &self, from: Uuid, to: Uuid, ) -> Option<ResourceEdgeKey>
Find the first directed resource edge between resource identities.
Sourcepub fn resource_relations(
&self,
) -> impl Iterator<Item = (ResourceEdgeKey, Uuid, Uuid, &EdgePayload)>
pub fn resource_relations( &self, ) -> impl Iterator<Item = (ResourceEdgeKey, Uuid, Uuid, &EdgePayload)>
Every retained Resource edge, with a typed handle and stable endpoints. This raw storage iterator includes tombstone-only buckets for history; ordinary projected reads filter to held topology.
Sourcepub fn retained_relations_between(
&self,
from: NodeKey,
to: NodeKey,
) -> impl Iterator<Item = (RelationKey, &EdgePayload)>
pub fn retained_relations_between( &self, from: NodeKey, to: NodeKey, ) -> impl Iterator<Item = (RelationKey, &EdgePayload)>
All retained Surface edges followed by retained edges between the resources shown, including tombstone-only assertion history. Parallel records and self-loops each appear once per directed pair.
Sourcepub fn projected_relations_between(
&self,
from: NodeKey,
to: NodeKey,
) -> impl Iterator<Item = (RelationKey, &EdgePayload)>
pub fn projected_relations_between( &self, from: NodeKey, to: NodeKey, ) -> impl Iterator<Item = (RelationKey, &EdgePayload)>
Directed held Surface edges followed by held edges between the
resources shown. Use retained_relations_between for explicit history.
Sourcepub fn projected_outgoing_relations(
&self,
from: NodeKey,
) -> impl Iterator<Item = (NodeKey, RelationKey, &EdgePayload)>
pub fn projected_outgoing_relations( &self, from: NodeKey, ) -> impl Iterator<Item = (NodeKey, RelationKey, &EdgePayload)>
Outgoing relations lifted to every surface showing their target resource.
Sourcepub fn projected_incoming_relations(
&self,
to: NodeKey,
) -> impl Iterator<Item = (NodeKey, RelationKey, &EdgePayload)>
pub fn projected_incoming_relations( &self, to: NodeKey, ) -> impl Iterator<Item = (NodeKey, RelationKey, &EdgePayload)>
Incoming relations lifted from every surface showing their source resource.
Source§impl Graph
impl Graph
Sourcepub fn resource(&self, id: Uuid) -> Option<&ResourceNode>
pub fn resource(&self, id: Uuid) -> Option<&ResourceNode>
Read a resource by its stable identity.
Sourcepub fn resource_nodes(&self) -> impl Iterator<Item = &ResourceNode>
pub fn resource_nodes(&self) -> impl Iterator<Item = &ResourceNode>
The resources currently held in this graph.
Sourcepub fn resource_edges(
&self,
) -> impl Iterator<Item = (&ResourceNode, &ResourceNode, &EdgePayload)>
pub fn resource_edges( &self, ) -> impl Iterator<Item = (&ResourceNode, &ResourceNode, &EdgePayload)>
Resource edges with their resource endpoints. Surface indices never cross this seam.
Sourcepub fn resource_facets(&self) -> &FacetStore<Uuid>
pub fn resource_facets(&self) -> &FacetStore<Uuid>
Resource metadata, separate from surface metadata.
Sourcepub fn shown_resource_id(&self, surface: NodeKey) -> Option<Uuid>
pub fn shown_resource_id(&self, surface: NodeKey) -> Option<Uuid>
The resource explicitly shown by a surface, when recorded.
Sourcepub fn surface_ids_showing_resource(&self, resource_id: Uuid) -> Vec<Uuid>
pub fn surface_ids_showing_resource(&self, resource_id: Uuid) -> Vec<Uuid>
Surface identities showing a resource, in stable order.
pub fn resource_record(&self, id: Uuid) -> Option<PersistedResourceRecord>
Sourcepub fn appearance_admission_revision(&self) -> u64
pub fn appearance_admission_revision(&self) -> u64
Runtime receipt for completed new shown-Resource associations. This advances on admission, including navigation to an already held Resource.
Source§impl Graph
impl Graph
Sourcepub fn persisted_resource_edges_between_bounded(
&self,
from: Uuid,
to: Uuid,
max_edges: usize,
max_bytes: usize,
) -> Result<Vec<PersistedEdge>, ResourceEdgesBoundError>
pub fn persisted_resource_edges_between_bounded( &self, from: Uuid, to: Uuid, max_edges: usize, max_bytes: usize, ) -> Result<Vec<PersistedEdge>, ResourceEdgesBoundError>
Capture all live rows for a directed resource pair, including session assertions omitted from durable snapshots. This is suitable for exact replacement, not a substitute for a durable graph snapshot.
max_edges limits pair rows. max_bytes independently limits each of
the raw payload and returned row JSON arrays, including array framing.
Both limits are checked before cloning any persisted rows. Pair lookup
scans source adjacency metadata; unrelated payloads are not serialized.
Source§impl Graph
impl Graph
pub fn resource_classification_variants( &self, id: Uuid, ) -> Vec<ClassificationVariant>
pub fn resource_classifications_conflicted(&self, id: Uuid) -> bool
pub fn edit_resource_classification( &mut self, id: Uuid, variant_id: &str, status: Option<ClassificationStatus>, primary: Option<bool>, ) -> Result<bool, ContentError>
pub fn remove_resource_classification( &mut self, id: Uuid, variant_id: &str, ) -> Result<bool, ContentError>
Source§impl Graph
impl Graph
Sourcepub fn validate_active_resource_assertion_handles(
&self,
) -> Result<(), ContentError>
pub fn validate_active_resource_assertion_handles( &self, ) -> Result<(), ContentError>
Check Resource handle ownership after a host overlays retained Surface facets. Held Surface-only duplicates keep their historical grammar. Checked open and replayed writes share this one rule; a replayed edge set also keeps each handle to one row.
Source§impl Graph
impl Graph
pub fn resource_properties(&self, id: Uuid) -> Vec<NodeProperty>
pub fn append_resource_properties( &mut self, id: Uuid, incoming: Vec<NodeProperty>, ) -> Result<bool, ContentError>
pub fn retract_resource_property( &mut self, id: Uuid, statement_id: &str, ) -> Result<bool, ContentError>
Source§impl Graph
impl Graph
pub fn resource_tag_concept(&self, id: Uuid) -> Option<TagConcept>
pub fn resource_tag_labels(&self, id: Uuid) -> HashSet<String>
Content tags of the shown resource; raw Surface tags remain legacy fallback.
Sourcepub fn define_tag_concept(
&mut self,
id: Uuid,
concept: TagConcept,
) -> Result<bool, ContentError>
pub fn define_tag_concept( &mut self, id: Uuid, concept: TagConcept, ) -> Result<bool, ContentError>
Preserve an explicit SKOS concept’s prepared IRI and declared owner.
Sourcepub fn tag_resource_with_concept(
&mut self,
resource_id: Uuid,
concept_iri: &str,
concept: TagConcept,
) -> Result<bool, ContentError>
pub fn tag_resource_with_concept( &mut self, resource_id: Uuid, concept_iri: &str, concept: TagConcept, ) -> Result<bool, ContentError>
Reuse an explicitly named concept, including one in another owner’s vocabulary.
Sourcepub fn tag_resource_with_asserter(
&mut self,
resource_id: Uuid,
concept_iri: &str,
concept: TagConcept,
asserter_iri: String,
) -> Result<bool, ContentError>
pub fn tag_resource_with_asserter( &mut self, resource_id: Uuid, concept_iri: &str, concept: TagConcept, asserter_iri: String, ) -> Result<bool, ContentError>
Tag with an explicit imported source rather than the host’s Author fallback.
Source§impl Graph
impl Graph
Sourcepub fn couplings_for_field(
&self,
field: FieldId,
) -> impl Iterator<Item = &Coupling> + '_
pub fn couplings_for_field( &self, field: FieldId, ) -> impl Iterator<Item = &Coupling> + '_
Couplings whose target is the given field.
Sourcepub fn field_coupling_strength(&self, field: FieldId) -> Option<f32>
pub fn field_coupling_strength(&self, field: FieldId) -> Option<f32>
The strength of the first coupling targeting field, if any (a field
carries one default coupling). For the roster’s per-field strength readout.
(Field regions — strength tuning.)
Sourcepub fn nodes_matching<'a>(
&'a self,
selector: &'a NodeSelector,
) -> impl Iterator<Item = NodeKey> + 'a
pub fn nodes_matching<'a>( &'a self, selector: &'a NodeSelector, ) -> impl Iterator<Item = NodeKey> + 'a
Resolve a coupling’s NodeSelector to the matching nodes, against node
tags and classifications. Kind(k) matches a node carrying any
affirmative classification whose value is k (the v1 interpretation; a
scheme-qualified match can refine it later).
Source§impl Graph
impl Graph
Sourcepub fn collect_node_traversals(
&self,
key: NodeKey,
) -> Option<Vec<DissolvedTraversalRecord>>
pub fn collect_node_traversals( &self, key: NodeKey, ) -> Option<Vec<DissolvedTraversalRecord>>
Collect traversals from all incident edges without mutating graph state.
Sourcepub fn assert_semantic_statement(
&mut self,
from: NodeKey,
to: NodeKey,
spec: SemanticStatementSpec,
) -> Option<(RelationKey, StatementAssert)>
pub fn assert_semantic_statement( &mut self, from: NodeKey, to: NodeKey, spec: SemanticStatementSpec, ) -> Option<(RelationKey, StatementAssert)>
Statement-aware assert (petgraph-RDF Phase 1 write API): assert one
semantic statement with full per-statement metadata on the (from, to)
pair bucket, creating the bucket edge if absent. Content-dedup returns
the EXISTING fact handle (updating its metadata in place); a genuine
change bumps the revision. This compatibility surface writer remains
during P2 integration; the checked counterpart uses durable placement.
Sourcepub fn assert_persisted_semantic_statement(
&mut self,
from: NodeKey,
to: NodeKey,
statement: SemanticStatement,
) -> Option<RelationKey>
pub fn assert_persisted_semantic_statement( &mut self, from: NodeKey, to: NodeKey, statement: SemanticStatement, ) -> Option<RelationKey>
Assert a semantic statement whose id is ALREADY minted — the re-ingest /
round-trip path (a reifier carried the fact handle, and preserving it is
what makes RDF -> kernel -> RDF id-stable). Reasserting the same
asserter updates its existing handle; endpoints must exist. The checked
counterpart supplies declaration-aware placement and collision errors.
Sourcepub fn retract_semantic_statement(
&mut self,
_from: NodeKey,
_to: NodeKey,
statement_id: &str,
) -> bool
pub fn retract_semantic_statement( &mut self, _from: NodeKey, _to: NodeKey, statement_id: &str, ) -> bool
Compatibility spelling for an authored exact-ID withdrawal. The assertion remains as a tombstone in its original pair bucket.
Sourcepub fn retract_relations_where(
&mut self,
from: NodeKey,
to: NodeKey,
selector: RelationSelector,
allow: impl FnMut(&SemanticStatement) -> bool,
) -> Retraction
pub fn retract_relations_where( &mut self, from: NodeKey, to: NodeKey, selector: RelationSelector, allow: impl FnMut(&SemanticStatement) -> bool, ) -> Retraction
retract_relations that asks allow about
each statement before withdrawing it, across both strata of the pair.
A refused statement stays held and is counted in Retraction::refused.
Traversal history holds no statements, so allow is not consulted for
that family.
Sourcepub fn get_edge(&self, key: EdgeKey) -> Option<&EdgePayload>
pub fn get_edge(&self, key: EdgeKey) -> Option<&EdgePayload>
Get an edge payload by key.
Sourcepub fn find_edge_key(&self, from: NodeKey, to: NodeKey) -> Option<EdgeKey>
pub fn find_edge_key(&self, from: NodeKey, to: NodeKey) -> Option<EdgeKey>
Find the first directed edge key between two nodes.
Sourcepub fn edges_between_undirected(
&self,
a: NodeKey,
b: NodeKey,
) -> impl Iterator<Item = (EdgeKey, &EdgePayload)> + '_
pub fn edges_between_undirected( &self, a: NodeKey, b: NodeKey, ) -> impl Iterator<Item = (EdgeKey, &EdgePayload)> + '_
Every edge between a and b in either direction: all a->b
edges first, then all b->a edges, each run in petgraph’s
edges_connecting order (deterministic for a given graph). The
substrate is a multigraph, so a pair may carry an antiparallel
or parallel set; read predicates that mean “the pair” rather
than “the first arc” go through here instead of
Self::find_edge_key. Self-loops (a == b) are yielded once.
Source§impl Graph
impl Graph
Sourcepub fn find_node_by_address(
&self,
address: &Address,
) -> Option<(NodeKey, &Node)>
pub fn find_node_by_address( &self, address: &Address, ) -> Option<(NodeKey, &Node)>
Find a node whose AddressClaims include the given address (any
AddressRole). Returns an arbitrary matching node when multiple
nodes share the address — the caller is expected to handle
duplicates explicitly when relevant.
Canonical address lookup per the node identity + duplicates
brief;
supersedes the URL-string-keyed get_node_by_url (which is
retained as a transitional shim — see below).
Sourcepub fn get_node_by_url(&self, url: &str) -> Option<(NodeKey, &Node)>
pub fn get_node_by_url(&self, url: &str) -> Option<(NodeKey, &Node)>
Convenience wrapper over Graph::find_node_by_address for
callers that have a URL string rather than a typed [Address].
Builds the [Address] internally and delegates.
Use this for tests and quick lookups; prefer
Graph::find_node_by_address in code paths that already have a
typed [Address] in hand.
Sourcepub fn get_nodes_by_url(&self, url: &str) -> Vec<NodeKey> ⓘ
pub fn get_nodes_by_url(&self, url: &str) -> Vec<NodeKey> ⓘ
Get all node keys currently mapped to a URL.
Sourcepub fn get_node_key_by_id(&self, id: Uuid) -> Option<NodeKey>
pub fn get_node_key_by_id(&self, id: Uuid) -> Option<NodeKey>
Get node key by UUID.
Sourcepub fn nodes(&self) -> impl Iterator<Item = (NodeKey, &Node)>
pub fn nodes(&self) -> impl Iterator<Item = (NodeKey, &Node)>
Iterate over all nodes as (key, node) pairs
Sourcepub fn relations(&self) -> impl Iterator<Item = RelationView> + '_
pub fn relations(&self) -> impl Iterator<Item = RelationView> + '_
Iterate over all stored relations, one row per recognized
statement/family carried by the pair-local edge bucket.
One EdgePayload between two nodes may therefore yield
multiple semantic rows.
Canonical read surface per the 2026-05-11 relation-taxonomy
plan §2. Stage 4 removed the legacy EdgeType-flavoured
edges() iterator that this replaces.
Sourcepub fn surface_relation_buckets(
&self,
) -> impl Iterator<Item = (EdgeKey, NodeKey, NodeKey, &EdgePayload)> + '_
pub fn surface_relation_buckets( &self, ) -> impl Iterator<Item = (EdgeKey, NodeKey, NodeKey, &EdgePayload)> + '_
Retained Surface buckets without expanding statements or lifting Resource relations. Each handle names its exact bucket, including parallel pairs. This is a raw retained-history view; use held relation iterators for ordinary reads. Tombstone-only buckets remain included.
Sourcepub fn surface_outgoing_relation_buckets(
&self,
from: NodeKey,
) -> impl Iterator<Item = (EdgeKey, NodeKey, NodeKey, &EdgePayload)> + '_
pub fn surface_outgoing_relation_buckets( &self, from: NodeKey, ) -> impl Iterator<Item = (EdgeKey, NodeKey, NodeKey, &EdgePayload)> + '_
Held Surface buckets outgoing from from, including every parallel
bucket without expanding its assertions. Cost is proportional to the
node’s out-degree.
Sourcepub fn projected_relations(
&self,
) -> impl Iterator<Item = (RelationKey, RelationView)> + '_
pub fn projected_relations( &self, ) -> impl Iterator<Item = (RelationKey, RelationView)> + '_
Surface relations followed by content relations lifted to every pair of surfaces showing their endpoints. The handle retains its owning store; projection does not copy resource assertions into the surface graph.
Sourcepub fn projected_assertions(
&self,
) -> impl Iterator<Item = (RelationKey, NodeKey, NodeKey, &SemanticStatement)> + '_
pub fn projected_assertions( &self, ) -> impl Iterator<Item = (RelationKey, NodeKey, NodeKey, &SemanticStatement)> + '_
Every exact held assertion lifted to its displayed endpoint pairs. Traversal remains an event rollup and is not an assertion record.
Sourcepub fn outgoing_relations(
&self,
key: NodeKey,
) -> impl Iterator<Item = RelationView> + '_
pub fn outgoing_relations( &self, key: NodeKey, ) -> impl Iterator<Item = RelationView> + '_
Relations whose from endpoint is key, expanded with exactly the
row semantics of Self::relations but visiting only that node’s
outgoing edges. Cost is proportional to the node’s out-degree, not
the graph’s edge count.
Sourcepub fn incoming_relations(
&self,
key: NodeKey,
) -> impl Iterator<Item = RelationView> + '_
pub fn incoming_relations( &self, key: NodeKey, ) -> impl Iterator<Item = RelationView> + '_
Relations whose to endpoint is key, expanded with exactly the
row semantics of Self::relations but visiting only that node’s
incoming edges. Cost is proportional to the node’s in-degree, not
the graph’s edge count.
pub fn semantic_edges(&self) -> impl Iterator<Item = SemanticEdgeView> + '_
pub fn arrangement_edges( &self, ) -> impl Iterator<Item = ArrangementEdgeView> + '_
pub fn containment_edges( &self, ) -> impl Iterator<Item = ContainmentEdgeView> + '_
Sourcepub fn derive_containment_for(&mut self, key: NodeKey)
pub fn derive_containment_for(&mut self, key: NodeKey)
Derive the containment this one node’s address implies, at the moment the node is created.
Current relation routing stores this assertion on Resources. Ordinary snapshot loading separately rebuilds compatibility Surface containment; recorded loading preserves stored relations without that rebuild. Both strata are included in snapshots.
The UrlPath half of [rebuild_derived_containment_relations],
applied to a single node. It exists because that rebuild runs only on
snapshot load, which used to mean a node visited under a folder had no
containment edge until the session was saved and reloaded. Anything
reading containment live (a graph behavior’s watch, which names a
region by its container) saw nothing there. Deriving at creation makes
the local relation available before the first save.
The Domain half is deliberately not here. A domain anchor is the shallowest node on a host, so minting one node can re-anchor every other node sharing that host: a whole-graph fact, which stays with the whole-graph rebuild. This one is purely local, which is what makes it cheap enough to run per node.
Sourcepub fn out_neighbors(&self, key: NodeKey) -> impl Iterator<Item = NodeKey> + '_
pub fn out_neighbors(&self, key: NodeKey) -> impl Iterator<Item = NodeKey> + '_
Iterate outgoing neighbor keys for a node
Sourcepub fn in_neighbors(&self, key: NodeKey) -> impl Iterator<Item = NodeKey> + '_
pub fn in_neighbors(&self, key: NodeKey) -> impl Iterator<Item = NodeKey> + '_
Iterate incoming neighbor keys for a node
Sourcepub fn neighbors_undirected(
&self,
key: NodeKey,
) -> impl Iterator<Item = NodeKey> + '_
pub fn neighbors_undirected( &self, key: NodeKey, ) -> impl Iterator<Item = NodeKey> + '_
Iterate undirected neighbor keys for a node, Surface stratum only.
projected_neighbors reads both strata.
Sourcepub fn projected_neighbors(
&self,
key: NodeKey,
) -> impl Iterator<Item = NodeKey> + '_
pub fn projected_neighbors( &self, key: NodeKey, ) -> impl Iterator<Item = NodeKey> + '_
Every node adjacent to key in either direction across both strata: the
Surface neighbours, plus the surfaces showing the far end of each Resource
relation of the resource key shows. One entry per incident held relation,
so parallel relations repeat; a self-loop is read once, from its outgoing
side, so a node adjacent to itself appears once. Hides are a view concern
and do not apply here.
Sourcepub fn neighbors_undirected_sorted(&self, key: NodeKey) -> Vec<NodeKey> ⓘ
pub fn neighbors_undirected_sorted(&self, key: NodeKey) -> Vec<NodeKey> ⓘ
Undirected neighbors sorted by stable node-key order.
Sourcepub fn connected_frame_import_nodes(&self, seeds: &[NodeKey]) -> Vec<NodeKey> ⓘ
pub fn connected_frame_import_nodes(&self, seeds: &[NodeKey]) -> Vec<NodeKey> ⓘ
Seed nodes plus one-hop undirected neighbors for frame import workflows.
Sourcepub fn connected_candidates_with_depth(
&self,
source: NodeKey,
max_depth: u8,
) -> Vec<(NodeKey, u8)>
pub fn connected_candidates_with_depth( &self, source: NodeKey, max_depth: u8, ) -> Vec<(NodeKey, u8)>
Connected candidate expansion around a source node with depth annotations.
max_depth currently supports 1 or 2, matching connected-open scope behavior.
Sourcepub fn hop_distances_from(&self, source: NodeKey) -> HashMap<NodeKey, usize>
pub fn hop_distances_from(&self, source: NodeKey) -> HashMap<NodeKey, usize>
Undirected hop distances from source using unit edge weights.
Sourcepub fn orphan_node_keys(&self) -> Vec<NodeKey> ⓘ
pub fn orphan_node_keys(&self) -> Vec<NodeKey> ⓘ
Nodes with no incoming or outgoing edges.
Sourcepub fn shortest_path(&self, from: NodeKey, to: NodeKey) -> Option<Vec<NodeKey>>
pub fn shortest_path(&self, from: NodeKey, to: NodeKey) -> Option<Vec<NodeKey>>
Shortest undirected path between two nodes using unit edge weights.
Sourcepub fn is_reachable(&self, from: NodeKey, to: NodeKey) -> bool
pub fn is_reachable(&self, from: NodeKey, to: NodeKey) -> bool
Reachability in the undirected graph.
Sourcepub fn weakly_connected_components(&self) -> Vec<Vec<NodeKey>>
pub fn weakly_connected_components(&self) -> Vec<Vec<NodeKey>>
Weakly connected components of the surface stratum (undirected projection),
a topology metric like Self::orphan_node_keys. Resource relations and
shown bindings do not join here; the semantic Component is
Self::component_members.
Sourcepub fn component_members(
&self,
seed: Uuid,
selectors: &[RelationSelector],
) -> Vec<Uuid>
pub fn component_members( &self, seed: Uuid, selectors: &[RelationSelector], ) -> Vec<Uuid>
Surfaces reachable from seed through either stratum’s undirected relations.
Shown bindings join at zero hops, including through unshown resources.
Empty if seed is not a surface in the graph. selectors is the
edge projection: only edges matching a selector are followed (an empty slice
follows every family). So the same nodes can be one Component under one projection
and a different one under another. The Component subgraph’s derivation. (Subgraph
derivation, Phase 3 — selectors.)
Sourcepub fn ego_members(
&self,
seed: Uuid,
radius: u8,
selectors: &[RelationSelector],
) -> Vec<Uuid>
pub fn ego_members( &self, seed: Uuid, radius: u8, selectors: &[RelationSelector], ) -> Vec<Uuid>
The Ego neighborhood of seed: surfaces within radius undirected
relation hops across both strata. Shown bindings cost zero, so radius 0
also includes surfaces showing the seed’s resource. Uses the selectors
edge projection (empty = all families). The Ego subgraph’s derivation. (Subgraph
derivation, Phase 3 — selectors.)
Sourcepub fn strongly_connected_components(&self) -> Vec<Vec<NodeKey>>
pub fn strongly_connected_components(&self) -> Vec<Vec<NodeKey>>
Strongly connected components in the directed graph.
Sourcepub fn has_edge_between(&self, from: NodeKey, to: NodeKey) -> bool
pub fn has_edge_between(&self, from: NodeKey, to: NodeKey) -> bool
Check if a directed edge exists from from to to
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Count of nodes in the graph
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Count of retained Surface buckets, including tombstone-only history. Use held topology queries when asking how many relations are active.
Source§impl Graph
impl Graph
Sourcepub fn node_display_label(&self, key: NodeKey) -> String
pub fn node_display_label(&self, key: NodeKey) -> String
A human-meaningful label for key’s node (see the module docs for the
derivation). Empty string if the key is not in the graph. Full text, not
width-clamped: a caller drawing into a fixed box truncates.
Sourcepub fn node_display_caption(&self, key: NodeKey) -> String
pub fn node_display_caption(&self, key: NodeKey) -> String
The document’s label with its host appended (label · host) when the
label does not already name it: the at-rest “where am I” caption. The
one label with a host added, not a second derivation.
Source§impl Graph
impl Graph
Sourcepub fn try_from_snapshot(
snapshot: &GraphSnapshot,
) -> Result<Self, ResourceSnapshotError>
pub fn try_from_snapshot( snapshot: &GraphSnapshot, ) -> Result<Self, ResourceSnapshotError>
Check all explicit resource columns and navigation indices before loading either graph stratum. Legacy surface conversion retains its existing compatibility behavior.
Sourcepub fn try_from_recorded_snapshot(
snapshot: &GraphSnapshot,
) -> Result<Self, ResourceSnapshotError>
pub fn try_from_recorded_snapshot( snapshot: &GraphSnapshot, ) -> Result<Self, ResourceSnapshotError>
Load caller-qualified recorded truth without deriving relations from current URLs. Explicit resource columns and navigation receive the same validation as legacy loads.
Source§impl Graph
impl Graph
Sourcepub fn from_snapshot(snapshot: &GraphSnapshot) -> Self
pub fn from_snapshot(snapshot: &GraphSnapshot) -> Self
Load a snapshot, stopping on invalid explicit resource data or
navigation indices. Fallible load boundaries should use
Self::try_from_snapshot.
Source§impl Graph
impl Graph
Sourcepub fn to_snapshot(&self) -> GraphSnapshot
pub fn to_snapshot(&self) -> GraphSnapshot
The graph’s snapshot, dated now by the wall clock.
Sourcepub fn to_snapshot_at(&self, timestamp_secs: u64) -> GraphSnapshot
pub fn to_snapshot_at(&self, timestamp_secs: u64) -> GraphSnapshot
The graph’s snapshot dated timestamp_secs, reading no clock: two
snapshots of one graph at one date are equal whenever they are taken
(reservoir plan ruling 47).
Source§impl Graph
impl Graph
Sourcepub fn persisted_edges_between(
&self,
from: NodeKey,
to: NodeKey,
) -> Vec<PersistedEdge>
pub fn persisted_edges_between( &self, from: NodeKey, to: NodeKey, ) -> Vec<PersistedEdge>
Every live Surface edge from from to to, in exact capture order.
Retains session arrangements that durable snapshots intentionally omit.
Source§impl Graph
impl Graph
Sourcepub fn set_recorder(&mut self, recorder: Option<DeltaRecorder>)
pub fn set_recorder(&mut self, recorder: Option<DeltaRecorder>)
Send every delta this graph applies through apply_graph_delta to
recorder, or stop with None. The per-graph twin of the thread’s
capture hook: a host holding many session graphs records each into its
own journal. A clone of this graph, and a replay onto it, record nothing.
Sourcepub fn is_recording(&self) -> bool
pub fn is_recording(&self) -> bool
Whether this graph records its deltas.
The recorder identity used when a writer has no attributed source.
Sourcepub fn write_as<R>(
&mut self,
author: Author,
write: impl FnOnce(&mut Self) -> R,
) -> R
pub fn write_as<R>( &mut self, author: Author, write: impl FnOnce(&mut Self) -> R, ) -> R
Run a write under the same author its journal will record.
Sourcepub fn set_current_session(&mut self, session: u64)
pub fn set_current_session(&mut self, session: u64)
Set the current app-launch session number (Alembic B5). The host calls this once,
right after construction or snapshot-restore, with its persisted-and-incremented
session counter; every navigate_node call afterwards stamps
the visited node’s [Node::last_session_visited] with this value.
Sourcepub fn current_session(&self) -> u64
pub fn current_session(&self) -> u64
The launch number set_current_session installed.
Sourcepub fn revision(&self) -> u64
pub fn revision(&self) -> u64
The current structural revision (see revision). A consumer captures it
alongside a derived result and recomputes only when it has advanced. (Graph signals.)
Sourcepub fn url_grouping_revision(&self) -> u64
pub fn url_grouping_revision(&self) -> u64
The current URL-authority grouping revision. This advances only when a node’s primary URL moves between site groups, letting site-grouped projections refresh without invalidating structural caches for an ordinary same-site navigation.
Sourcepub fn content_revision(&self) -> u64
pub fn content_revision(&self) -> u64
The current content revision (see the field’s doc): it advances on a node’s title or primary URL changing and on a node joining or leaving, never on an edge or relation change.
Sourcepub fn visit_revision(&self) -> u64
pub fn visit_revision(&self) -> u64
The current visit revision (see the field’s doc): it advances when a node’s visit history may have changed, never on structure or text.
Sourcepub fn url_grouping_key(url: &str) -> &str
pub fn url_grouping_key(url: &str) -> &str
The categorical site key used by URL-grouped projections: the authority
after :// and before a path, query, or fragment, or the whole hostless
input. It deliberately retains ports and opaque values.
Sourcepub fn node_namespace_id(url: &str) -> Uuid
pub fn node_namespace_id(url: &str) -> Uuid
The deterministic node UUID for url: a name-based UUIDv5 under
NODE_NAMESPACE. Two hosts that materialize the
same url mint the same id, so a federated merge needs no identity
reconciliation. The linked-data ingest layer uses this for a document’s
@id, where the URL is the identity. Raw [add_node] keeps a fresh
random id, because the kernel treats a node’s address as a property and
lets several nodes share one (see get_nodes_by_url).
Sourcepub fn node_can_back(&self, key: NodeKey) -> bool
pub fn node_can_back(&self, key: NodeKey) -> bool
Whether key’s within-node history can step back (toolbar gating).
Sourcepub fn node_can_forward(&self, key: NodeKey) -> bool
pub fn node_can_forward(&self, key: NodeKey) -> bool
Whether key’s within-node history can step forward (toolbar gating).
Sourcepub fn node_history_projection(&self, key: NodeKey) -> NodeHistoryProjection
pub fn node_history_projection(&self, key: NodeKey) -> NodeHistoryProjection
key’s linear-history projection (active path + cursor).
Sourcepub fn node_history_branch_projection(
&self,
key: NodeKey,
) -> NodeHistoryBranchProjection
pub fn node_history_branch_projection( &self, key: NodeKey, ) -> NodeHistoryBranchProjection
key’s branching-history projection (visit tree with alternates).
Sourcepub fn node_history_semantic_summary(
&self,
key: NodeKey,
) -> NodeHistorySemanticSummary
pub fn node_history_semantic_summary( &self, key: NodeKey, ) -> NodeHistorySemanticSummary
A coarse semantic summary of key’s history.
Trait Implementations§
Source§impl Archive for Graph
impl Archive for Graph
Source§type Archived = <GraphSnapshot as Archive>::Archived
type Archived = <GraphSnapshot as Archive>::Archived
Source§type Resolver = <GraphSnapshot as Archive>::Resolver
type Resolver = <GraphSnapshot as Archive>::Resolver
Source§fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
Source§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
serialize. Read moreSource§impl<D> Deserialize<Graph, D> for Archived<GraphSnapshot>
impl<D> Deserialize<Graph, D> for Archived<GraphSnapshot>
Auto Trait Implementations§
impl !RefUnwindSafe for Graph
impl !UnwindSafe for Graph
impl Freeze for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnsafeUnpin for Graph
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,
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>
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.