Skip to main content

LpgStore

Struct LpgStore 

Source
pub struct LpgStore { /* private fields */ }
Expand description

The main LPG graph store.

This is the core storage for labeled property graphs, providing efficient node/edge storage and adjacency indexing.

Implementations§

Source§

impl LpgStore

Source

pub fn new() -> Self

Creates a new LPG store with default configuration.

Source

pub fn with_config(config: LpgStoreConfig) -> Self

Creates a new LPG store with custom configuration.

Source

pub fn current_epoch(&self) -> EpochId

Returns the current epoch.

Source

pub fn new_epoch(&self) -> EpochId

Creates a new epoch.

Source

pub fn create_node(&self, labels: &[&str]) -> NodeId

Creates a new node with the given labels.

Source

pub fn create_node_with_props( &self, labels: &[&str], properties: impl IntoIterator<Item = (impl Into<PropertyKey>, impl Into<Value>)>, ) -> NodeId

Creates a new node with labels and properties.

Source

pub fn get_node(&self, id: NodeId) -> Option<Node>

Gets a node by ID.

Source

pub fn delete_node(&self, id: NodeId) -> bool

Deletes a node and all its edges.

Source

pub fn node_count(&self) -> usize

Returns the number of nodes.

Source

pub fn create_edge(&self, src: NodeId, dst: NodeId, edge_type: &str) -> EdgeId

Creates a new edge.

Source

pub fn create_edge_with_props( &self, src: NodeId, dst: NodeId, edge_type: &str, properties: impl IntoIterator<Item = (impl Into<PropertyKey>, impl Into<Value>)>, ) -> EdgeId

Creates a new edge with properties.

Source

pub fn get_edge(&self, id: EdgeId) -> Option<Edge>

Gets an edge by ID.

Source

pub fn delete_edge(&self, id: EdgeId) -> bool

Deletes an edge.

Source

pub fn edge_count(&self) -> usize

Returns the number of edges.

Source

pub fn neighbors( &self, node: NodeId, direction: Direction, ) -> impl Iterator<Item = NodeId> + '_

Returns an iterator over neighbors of a node.

Source

pub fn nodes_by_label(&self, label: &str) -> Vec<NodeId>

Returns nodes with a specific label.

Trait Implementations§

Source§

impl Default for LpgStore

Source§

fn default() -> Self

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

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

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.