Skip to main content

GraphStoreHandle

Enum GraphStoreHandle 

Source
pub enum GraphStoreHandle {
    Memory(MemoryGraphStore),
    Persistent(PersistentGraphStore),
}

Variants§

Implementations§

Source§

impl GraphStoreHandle

Source

pub fn observe_definition( &self, kind: GraphDefinitionKind, name: Option<&str>, ) -> GraphStoreResult<()>

Record a semantic definition read from a retained catalog cache without loading graph data.

Source

pub fn with_serializable_read( self, context: SerializableReadContext, cancellation: &CancellationToken, ) -> Self

Source

pub fn without_serializable_read(self) -> Self

Source

pub fn for_statistics(&self) -> Cow<'_, Self>

Cost estimation retains the same data without creating semantic query reads. The primary in-memory graph remains borrowed; persistent handles share their original storage and retained resources.

Source

pub fn from_catalog( catalog: Arc<dyn CatalogFacade>, backend: Arc<dyn PersistentStorageBackend>, ) -> Self

Source

pub fn transaction_mapped<T, E>( &mut self, operation: impl FnOnce(&mut Self) -> Result<T, E>, map_error: impl Fn(GraphStoreError) -> E, ) -> Result<T, E>
where E: Display,

Preserve caller error types while storage checkpoints (or the primary memory store) roll back the complete operation on errors and panics.

Source

pub fn label_registry( &self, graph: &str, ) -> GraphStoreResult<GraphLabelRegistry>

Source

pub fn graph_labels(&self, graph: &str) -> GraphStoreResult<Vec<GraphLabelInfo>>

Source

pub fn graph_label_kind( &self, graph: &str, label: &str, ) -> GraphStoreResult<Option<LabelKind>>

Source

pub fn create_label( &mut self, graph: &str, label: &str, kind: LabelKind, ) -> GraphStoreResult<Option<u32>>

Source

pub fn drop_label( &mut self, graph: &str, label: &str, ) -> GraphStoreResult<Option<(u32, LabelKind)>>

Source

pub fn rename_graph(&mut self, from: &str, to: &str) -> GraphStoreResult<()>

Source

pub fn import_label_registry( &mut self, graph: &str, registry: &GraphLabelRegistry, ) -> GraphStoreResult<()>

Source

pub fn rebuild_label_registry_from_ids( &mut self, graph: &str, ) -> GraphStoreResult<()>

Trait Implementations§

Source§

impl Clone for GraphStoreHandle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GraphStoreHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GraphStoreHandle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl GraphStore for GraphStoreHandle

Source§

fn vertex_id_page( &self, graph: &str, after: Option<u64>, limit: usize, ) -> GraphStoreResult<Vec<u64>>

Bounded ascending vertex identities, exclusively after the cursor. Durable stores override this with an indexed storage cursor.
Source§

fn edge_id_page( &self, graph: &str, after: Option<u64>, limit: usize, ) -> GraphStoreResult<Vec<u64>>

Bounded ascending edge identities without materializing edge payloads.
Source§

fn transaction<T>( &mut self, operation: impl FnOnce(&mut Self) -> GraphStoreResult<T>, ) -> GraphStoreResult<T>

Apply a group of mutations atomically. Persistent stores use a storage transaction or savepoint, never a cloned graph as a rollback image. Both errors and unwinding must restore the pre-operation state.
Source§

fn create_graph(&mut self, name: &str) -> GraphStoreResult<()>

Create a new named graph. No-op if it already exists.
Source§

fn drop_graph(&mut self, name: &str) -> GraphStoreResult<()>

Drop a named graph and all of its membership entries. Vertex / edge records that aren’t referenced by any other graph become unreachable and are released.
Source§

fn graph_names(&self) -> GraphStoreResult<Vec<String>>

Return all graph names sorted ascending.
Source§

fn has_graph(&self, name: &str) -> GraphStoreResult<bool>

Source§

fn union_graphs( &mut self, g1: &str, g2: &str, target: &str, ) -> GraphStoreResult<()>

target := g1 union g2 over vertex and edge sets.
Source§

fn intersect_graphs( &mut self, g1: &str, g2: &str, target: &str, ) -> GraphStoreResult<()>

target := g1 intersect g2.
Source§

fn difference_graphs( &mut self, g1: &str, g2: &str, target: &str, ) -> GraphStoreResult<()>

target := g1 \ g2.
Source§

fn copy_graph(&mut self, source: &str, target: &str) -> GraphStoreResult<()>

Source§

fn add_vertex(&mut self, vertex: Vertex, graph: &str) -> GraphStoreResult<()>

Source§

fn add_edge(&mut self, edge: Edge, graph: &str) -> GraphStoreResult<()>

Source§

fn remove_vertex(&mut self, vertex_id: u64, graph: &str) -> GraphStoreResult<()>

Source§

fn remove_edge(&mut self, edge_id: u64, graph: &str) -> GraphStoreResult<()>

Source§

fn neighbors( &self, vertex_id: u64, label: Option<&str>, direction: Direction, graph: &str, ) -> GraphStoreResult<Vec<u64>>

Neighbor vertex ids reached from vertex_id along edges with the given label (or any label when label is None) in the given direction.
Source§

fn vertices_by_label( &self, label: &str, graph: &str, ) -> GraphStoreResult<Vec<Vertex>>

Source§

fn vertex_ids_by_label( &self, label: &str, graph: &str, ) -> GraphStoreResult<Vec<u64>>

Return only the vertex ids for a label. Stores with a label index should override this to avoid materializing full vertices.
Source§

fn vertices_in_graph(&self, graph: &str) -> GraphStoreResult<Vec<Vertex>>

Source§

fn edges_in_graph(&self, graph: &str) -> GraphStoreResult<Vec<Edge>>

Source§

fn vertex_graphs(&self, vertex_id: u64) -> GraphStoreResult<BTreeSet<String>>

Source§

fn edge_graphs(&self, edge_id: u64) -> GraphStoreResult<BTreeSet<String>>

Source§

fn edges_by_label( &self, label: &str, graph: &str, ) -> GraphStoreResult<Vec<Edge>>

Read only edges carrying a label. Durable stores push this predicate into their physical label index before fetching any payloads.
Source§

fn out_edge_ids( &self, vertex_id: u64, graph: &str, ) -> GraphStoreResult<BTreeSet<u64>>

Source§

fn in_edge_ids( &self, vertex_id: u64, graph: &str, ) -> GraphStoreResult<BTreeSet<u64>>

Source§

fn edge_ids_by_label( &self, label: &str, graph: &str, ) -> GraphStoreResult<BTreeSet<u64>>

Source§

fn vertex_ids_in_graph(&self, graph: &str) -> GraphStoreResult<BTreeSet<u64>>

Source§

fn require_vertex_in_graph( &self, vertex_id: u64, graph: &str, ) -> GraphStoreResult<()>

Require an explicit query vertex to be a live member of graph. Implementations may override this with a cheaper membership lookup. Missing query input is distinct from a valid vertex with no edges and must not be reported as an empty neighborhood/path result.
Source§

fn degree_distribution( &self, graph: &str, ) -> GraphStoreResult<BTreeMap<u64, u64>>

Source§

fn label_degree(&self, label: &str, graph: &str) -> GraphStoreResult<f64>

Source§

fn vertex_label_counts( &self, graph: &str, ) -> GraphStoreResult<BTreeMap<String, u64>>

Source§

fn get_vertex(&self, vertex_id: u64) -> GraphStoreResult<Option<Vertex>>

Fetch one owned record. A storage implementation must not retain all entities merely to return a borrow, and I/O failures are not absence.
Source§

fn for_each_vertex_borrowed( &self, ids: &[u64], visit: &mut dyn FnMut(u64, Option<&Vertex>) -> bool, ) -> GraphStoreResult<Option<usize>>

Visit requested vertices on the pinned view in caller order, retaining duplicates and missing rows. The internal callback must not reenter graph storage. Stop before reading another identity when it returns false. None declines without invoking it; Some counts invocations.
Source§

fn get_edge(&self, edge_id: u64) -> GraphStoreResult<Option<Edge>>

Source§

fn next_vertex_id(&mut self) -> GraphStoreResult<u64>

Returns and advances the next available vertex id.
Source§

fn next_edge_id(&mut self) -> GraphStoreResult<u64>

Returns and advances the next available edge id.
Source§

fn allocate_vertex_id( &mut self, label: &str, graph: &str, ) -> GraphStoreResult<u64>

Allocate a vertex id for a new entity with label inside graph. Stores that implement the Apache AGE graphid scheme override this to return (label_id << 48) | sequence; the default falls back to the store-wide counter.
Source§

fn allocate_edge_id( &mut self, label: &str, graph: &str, ) -> GraphStoreResult<u64>

Allocate an edge id for a new entity with label inside graph. See GraphStore::allocate_vertex_id.
Source§

fn clear(&mut self) -> GraphStoreResult<()>

Source§

fn vertices(&self) -> GraphStoreResult<BTreeMap<u64, Vertex>>

Snapshot every vertex in the store, keyed by id. Mirrors the vertices property on the current abstract GraphStore.
Source§

fn edges(&self) -> GraphStoreResult<BTreeMap<u64, Edge>>

Snapshot every edge in the store, keyed by id. Mirrors the edges property on the current abstract GraphStore.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.