pub struct GraphHandle { /* private fields */ }Implementations§
Source§impl GraphHandle
impl GraphHandle
pub fn new( path: &Path, durability: Durability, mmap_size: i64, lru_cache_size: NonZeroUsize, read_pool_size: usize, ) -> Result<Self>
pub fn get_entity(&self, name: &str) -> Result<Option<Entity>>
pub fn create_entities(&self, entities: &[Entity]) -> Result<Vec<Entity>>
pub fn delete_entities(&self, names: &[String]) -> Result<()>
pub fn create_relations(&self, relations: &[Relation]) -> Result<Vec<Relation>>
pub fn delete_relations(&self, relations: &[Relation]) -> Result<()>
pub fn add_observations( &self, entity_name: &str, contents: &[String], ) -> Result<Vec<String>>
pub fn delete_observations( &self, entity_name: &str, observations: &[String], ) -> Result<()>
pub fn upsert_entities(&self, entities: &[Entity]) -> Result<Vec<Entity>>
pub fn merge_entities(&self, source: &str, target: &str) -> Result<Entity>
pub fn search_nodes_filtered( &self, query: &str, filter_type: Option<&str>, offset: usize, limit: usize, ) -> Vec<Entity>
pub fn read_graph_filtered( &self, filter_type: Option<&str>, offset: usize, limit: usize, ) -> Result<String>
pub fn open_nodes(&self, names: &[String]) -> String
pub fn entities_exist(&self, names: &[String]) -> Result<Vec<bool>>
pub fn degree(&self, name: &str, direction: Direction) -> Result<usize>
pub fn get_entity_count(&self) -> Result<usize>
pub fn get_relation_count(&self) -> Result<usize>
pub fn search_relations( &self, from: Option<&str>, to: Option<&str>, rtype: Option<&str>, ) -> Vec<Relation>
pub fn find_path(&self, from: &str, to: &str) -> Result<Option<Vec<String>>>
pub fn compact(&self) -> Result<()>
pub fn neighbors( &self, name: &str, direction: Direction, rtype: Option<&str>, depth: u32, ) -> Result<String>
pub fn extract_subgraph(&self, names: &[String], depth: u32) -> Result<String>
pub fn describe_entity(&self, name: &str) -> Result<Entity>
pub fn entity_type_counts(&self) -> Vec<(String, usize)>
pub fn relation_type_counts(&self) -> Vec<(String, usize)>
pub fn batch_get_entities(&self, names: &[String]) -> Vec<Option<Entity>>
pub fn find_all_paths( &self, from: &str, to: &str, max_depth: usize, max_paths: usize, ) -> Result<Vec<Vec<String>>>
Sourcepub fn export(&self, _format: &str, max_rows: i64) -> Result<String>
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”.
pub fn wipe(&self) -> Result<()>
Sourcepub fn run_maintenance(&self) -> Result<()>
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§
impl !Freeze for GraphHandle
impl !RefUnwindSafe for GraphHandle
impl !UnwindSafe for GraphHandle
impl Send for GraphHandle
impl Sync for GraphHandle
impl Unpin for GraphHandle
impl UnsafeUnpin for GraphHandle
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