Skip to main content

NativeTxEngine

Struct NativeTxEngine 

Source
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<'_>

Source§

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>>>

Fetch a node by id, or Ok(None) if absent. Read more
Source§

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<()>

Delete a node (and its incident edges/indexes). Read more
Source§

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>>

Fetch an edge by id, or Ok(None) if absent. Read more
Source§

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<()>

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>>

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 more
Source§

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 more
Source§

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 more
Source§

fn all_nodes(&self) -> Result<Vec<Arc<Node>>>

Return every node in the store (a full scan — the label-less MATCH (n)). Read more
Source§

fn all_edges(&self) -> Result<Vec<Edge>>

Return every edge in the store (a full scan — the anonymous MATCH ()-[r]->()). Read more
Source§

fn nodes_by_kind( &self, kind: &str, limit: usize, offset: usize, ) -> Result<Vec<Arc<Node>>>

Return nodes of a given kind (label scan), paginated by limit / offset. Read more
Source§

fn export_dump(&self) -> Result<Dump>

Export the entire graph as a drevo-json-v1 Dump — every node and edge plus the id-allocation counters — the interchange format used for backup, JSON/GraphML round-trips, and cross-engine migration. Read more
Source§

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 more
Source§

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 more
Source§

fn count_nodes(&self) -> Result<u64>

The number of nodes in the store — the MATCH (n) RETURN count(*) pushdown target: a bare count needs no record materialisation at all. Read more
Source§

fn count_nodes_by_kind(&self, kind: &str) -> Result<u64>

The number of nodes whose primary kind equals kind — the kind half of the labelled-count pushdown (secondary _labels matches are the label index’s business, not the engine’s). Read more

Auto 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> 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> 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, 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.