Skip to main content

GraphHandle

Struct GraphHandle 

Source
pub struct GraphHandle { /* private fields */ }

Implementations§

Source§

impl GraphHandle

Source

pub fn new( path: &Path, durability: Durability, mmap_size: i64, lru_cache_size: NonZeroUsize, read_pool_size: usize, ) -> Result<Self>

Source

pub fn get_entity(&self, name: &str) -> Result<Option<Entity>>

Source

pub fn create_entities(&self, entities: &[Entity]) -> Result<Vec<Entity>>

Source

pub fn delete_entities(&self, names: &[String]) -> Result<()>

Source

pub fn create_relations(&self, relations: &[Relation]) -> Result<Vec<Relation>>

Source

pub fn delete_relations(&self, relations: &[Relation]) -> Result<()>

Source

pub fn add_observations( &self, entity_name: &str, contents: &[String], ) -> Result<Vec<String>>

Source

pub fn delete_observations( &self, entity_name: &str, observations: &[String], ) -> Result<()>

Source

pub fn upsert_entities(&self, entities: &[Entity]) -> Result<Vec<Entity>>

Source

pub fn merge_entities(&self, source: &str, target: &str) -> Result<Entity>

Source

pub fn search_nodes_filtered( &self, query: &str, filter_type: Option<&str>, offset: usize, limit: usize, ) -> Vec<Entity>

Source

pub fn read_graph_filtered( &self, filter_type: Option<&str>, offset: usize, limit: usize, ) -> Result<String>

Source

pub fn open_nodes(&self, names: &[String]) -> String

Source

pub fn entities_exist(&self, names: &[String]) -> Result<Vec<bool>>

Source

pub fn degree(&self, name: &str, direction: Direction) -> Result<usize>

Source

pub fn get_entity_count(&self) -> Result<usize>

Source

pub fn get_relation_count(&self) -> Result<usize>

Source

pub fn search_relations( &self, from: Option<&str>, to: Option<&str>, rtype: Option<&str>, ) -> Vec<Relation>

Source

pub fn find_path(&self, from: &str, to: &str) -> Result<Option<Vec<String>>>

Source

pub fn compact(&self) -> Result<()>

Source

pub fn neighbors( &self, name: &str, direction: Direction, rtype: Option<&str>, depth: u32, ) -> Result<String>

Source

pub fn extract_subgraph(&self, names: &[String], depth: u32) -> Result<String>

Source

pub fn describe_entity(&self, name: &str) -> Result<Entity>

Source

pub fn entity_type_counts(&self) -> Vec<(String, usize)>

Source

pub fn relation_type_counts(&self) -> Vec<(String, usize)>

Source

pub fn batch_get_entities(&self, names: &[String]) -> Vec<Option<Entity>>

Source

pub fn find_all_paths( &self, from: &str, to: &str, max_depth: usize, max_paths: usize, ) -> Result<Vec<Vec<String>>>

Source

pub fn export(&self, _format: &str, max_rows: i64) -> Result<String>

Export the whole graph as a JSON string. max_rows caps both the entity and relation arrays so a pathologically large graph cannot be coerced into an unbounded in-memory string (DoS guard); callers pass a generous constant. A negative value means “no limit”.

Source

pub fn wipe(&self) -> Result<()>

Source

pub fn run_maintenance(&self) -> Result<()>

Periodic database maintenance: WAL checkpoint, query planner analysis, and FTS index optimization. Call from a background timer.

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<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more