pub struct NativeTxEngine<'a> { /* private fields */ }Expand description
A per-statement GraphEngine view of one registered transaction:
reads serve the transaction’s working copy (read-your-writes), writes
buffer onto it — nothing touches the live graph until
NativeGraph::tx_commit. Derived fresh for each statement via
NativeGraph::tx_engine, so a session never holds a borrow across
statements. Every operation locks the slot table briefly; concurrent
statements in different transactions serialize per operation, not per
statement.
Trait Implementations§
Source§impl GraphEngine for NativeTxEngine<'_>
impl GraphEngine for NativeTxEngine<'_>
Source§fn create_node(&self, new_node: NewNode) -> Result<Node>
fn create_node(&self, new_node: NewNode) -> Result<Node>
Create a node, allocating its id/uuid/timestamps. Read more
Source§fn get_node(&self, id: u64) -> Result<Option<Arc<Node>>>
fn get_node(&self, id: u64) -> Result<Option<Arc<Node>>>
Fetch a node by id, or
Ok(None) if absent. Read moreSource§fn update_node(&self, id: u64, patch: NodePatch) -> Result<Node>
fn update_node(&self, id: u64, patch: NodePatch) -> Result<Node>
Apply a partial update to a node. Read more
Source§fn delete_node(&self, id: u64) -> Result<()>
fn delete_node(&self, id: u64) -> Result<()>
Delete a node (and its incident edges/indexes). Read more
Source§fn create_edge(&self, new_edge: NewEdge) -> Result<Edge>
fn create_edge(&self, new_edge: NewEdge) -> Result<Edge>
Create an edge between two existing nodes. Read more
Source§fn get_edge(&self, id: u64) -> Result<Option<Edge>>
fn get_edge(&self, id: u64) -> Result<Option<Edge>>
Fetch an edge by id, or
Ok(None) if absent. Read moreSource§fn update_edge(&self, id: u64, patch: EdgePatch) -> Result<Edge>
fn update_edge(&self, id: u64, patch: EdgePatch) -> Result<Edge>
Apply a partial update to an edge (kind / weight / properties). Read more
Source§fn delete_edge(&self, id: u64) -> Result<()>
fn delete_edge(&self, id: u64) -> Result<()>
Delete an edge (and its adjacency/index entries). Read more
Source§fn neighbor_ids(
&self,
node_id: u64,
direction: Direction,
kind: Option<&str>,
) -> Result<Vec<u64>>
fn neighbor_ids( &self, node_id: u64, direction: Direction, kind: Option<&str>, ) -> Result<Vec<u64>>
Return the distinct node ids adjacent to
node_id in direction,
optionally restricted to edges of kind — the id-only fan-out that reads
straight from the adjacency index. Read moreSource§fn neighbors(
&self,
node_id: u64,
direction: Direction,
kind: Option<&str>,
) -> Result<Vec<Arc<Node>>>
fn neighbors( &self, node_id: u64, direction: Direction, kind: Option<&str>, ) -> Result<Vec<Arc<Node>>>
Return the adjacent nodes (loaded once each) in
direction,
optionally restricted to edges of kind. Read moreSource§fn edges_of(&self, node_id: u64, direction: Direction) -> Result<Vec<Edge>>
fn edges_of(&self, node_id: u64, direction: Direction) -> Result<Vec<Edge>>
Return the full
Edge records incident to node_id in direction
(the weighted/full-edge expansion, which loads each edge record — unlike
neighbor_ids). Read moreSource§fn all_nodes(&self) -> Result<Vec<Arc<Node>>>
fn all_nodes(&self) -> Result<Vec<Arc<Node>>>
Return every node in the store (a full scan — the label-less
MATCH (n)). Read moreSource§fn all_edges(&self) -> Result<Vec<Edge>>
fn all_edges(&self) -> Result<Vec<Edge>>
Return every edge in the store (a full scan — the anonymous
MATCH ()-[r]->()). Read moreSource§fn nodes_by_kind(
&self,
kind: &str,
limit: usize,
offset: usize,
) -> Result<Vec<Arc<Node>>>
fn nodes_by_kind( &self, kind: &str, limit: usize, offset: usize, ) -> Result<Vec<Arc<Node>>>
Source§fn export_dump(&self) -> Result<Dump>
fn export_dump(&self) -> Result<Dump>
Source§fn apply_dump(&self, _dump: Dump) -> Result<ImportReport>
fn apply_dump(&self, _dump: Dump) -> Result<ImportReport>
Bulk-load a
Dump into this engine verbatim, preserving every
node/edge id (so edges stay connected) and clamping the id counters above
every imported id. Nodes/edges already present byte-for-byte are skipped
(idempotent re-import); an id that collides with different content, or
an edge whose endpoint is missing, is an error. Read moreSource§fn delete_nodes(&self, ids: &[u64]) -> Result<usize>
fn delete_nodes(&self, ids: &[u64]) -> Result<usize>
Delete many nodes in one batch, returning how many were actually
removed. Each node is dropped with its incident edges and index
entries exactly as
delete_node; ids that are
already absent are skipped rather than erroring. Read moreAuto Trait Implementations§
impl<'a> Freeze for NativeTxEngine<'a>
impl<'a> RefUnwindSafe for NativeTxEngine<'a>
impl<'a> Send for NativeTxEngine<'a>
impl<'a> Sync for NativeTxEngine<'a>
impl<'a> Unpin for NativeTxEngine<'a>
impl<'a> UnsafeUnpin for NativeTxEngine<'a>
impl<'a> UnwindSafe for NativeTxEngine<'a>
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