Skip to main content

GraphStorageMut

Trait GraphStorageMut 

Source
pub trait GraphStorageMut: GraphStorage {
Show 24 methods // Required methods fn try_create_node( &mut self, labels: Vec<String>, properties: Properties, ) -> Option<NodeRecord>; fn create_relationship( &mut self, src: NodeId, dst: NodeId, rel_type: &str, properties: Properties, ) -> Option<RelationshipRecord>; fn set_node_property( &mut self, node_id: NodeId, key: String, value: PropertyValue, ) -> bool; fn remove_node_property(&mut self, node_id: NodeId, key: &str) -> bool; fn add_node_label(&mut self, node_id: NodeId, label: &str) -> bool; fn remove_node_label(&mut self, node_id: NodeId, label: &str) -> bool; fn set_relationship_property( &mut self, rel_id: RelationshipId, key: String, value: PropertyValue, ) -> bool; fn remove_relationship_property( &mut self, rel_id: RelationshipId, key: &str, ) -> bool; fn delete_relationship(&mut self, rel_id: RelationshipId) -> bool; fn delete_node(&mut self, node_id: NodeId) -> bool; fn detach_delete_node(&mut self, node_id: NodeId) -> bool; fn clear(&mut self); // Provided methods fn create_node( &mut self, labels: Vec<String>, properties: Properties, ) -> NodeRecord where Self: Sized { ... } fn create_index( &mut self, _request: IndexRequest, _if_not_exists: bool, ) -> Result<CreateIndexOutcome, CreateIndexError> { ... } fn drop_index( &mut self, _name: &str, _if_exists: bool, ) -> Result<DropIndexOutcome, DropIndexError> { ... } fn create_constraint( &mut self, _request: ConstraintRequest, _if_not_exists: bool, ) -> Result<CreateConstraintOutcome, CreateConstraintError> { ... } fn drop_constraint( &mut self, _name: &str, _if_exists: bool, ) -> Result<DropConstraintOutcome, DropConstraintError> { ... } fn replace_node_properties( &mut self, node_id: NodeId, properties: Properties, ) -> bool where Self: Sized { ... } fn merge_node_properties( &mut self, node_id: NodeId, properties: Properties, ) -> bool { ... } fn set_node_labels(&mut self, node_id: NodeId, labels: Vec<String>) -> bool where Self: Sized { ... } fn replace_relationship_properties( &mut self, rel_id: RelationshipId, properties: Properties, ) -> bool where Self: Sized { ... } fn merge_relationship_properties( &mut self, rel_id: RelationshipId, properties: Properties, ) -> bool { ... } fn delete_relationships_of( &mut self, node_id: NodeId, direction: Direction, ) -> usize { ... } fn get_or_create_node( &mut self, labels: Vec<String>, match_key: &str, match_value: &PropertyValue, init_properties: Properties, ) -> NodeRecord where Self: Sized { ... }
}

Required Methods§

Source

fn try_create_node( &mut self, labels: Vec<String>, properties: Properties, ) -> Option<NodeRecord>

Source

fn create_relationship( &mut self, src: NodeId, dst: NodeId, rel_type: &str, properties: Properties, ) -> Option<RelationshipRecord>

Source

fn set_node_property( &mut self, node_id: NodeId, key: String, value: PropertyValue, ) -> bool

Source

fn remove_node_property(&mut self, node_id: NodeId, key: &str) -> bool

Source

fn add_node_label(&mut self, node_id: NodeId, label: &str) -> bool

Source

fn remove_node_label(&mut self, node_id: NodeId, label: &str) -> bool

Source

fn set_relationship_property( &mut self, rel_id: RelationshipId, key: String, value: PropertyValue, ) -> bool

Source

fn remove_relationship_property( &mut self, rel_id: RelationshipId, key: &str, ) -> bool

Source

fn delete_relationship(&mut self, rel_id: RelationshipId) -> bool

Source

fn delete_node(&mut self, node_id: NodeId) -> bool

Returns false if the node still has attached relationships.

Source

fn detach_delete_node(&mut self, node_id: NodeId) -> bool

Deletes the node and all attached relationships.

Source

fn clear(&mut self)

Drop every node and every relationship, returning the store to an empty state. Provided as a trait method so callers (bindings, admin tools) can reset a graph without knowing the concrete backend.

Future snapshot / WAL / restore entry points will also hang off the GraphStorageMut surface — clear is the first of them.

Provided Methods§

Source

fn create_node( &mut self, labels: Vec<String>, properties: Properties, ) -> NodeRecord
where Self: Sized,

Compatibility helper for callers that historically used the infallible creation surface. Query and binding paths should prefer Self::try_create_node so allocation/id exhaustion can surface as an ordinary error instead of a process panic.

Source

fn create_index( &mut self, _request: IndexRequest, _if_not_exists: bool, ) -> Result<CreateIndexOutcome, CreateIndexError>

Register an explicitly-declared index in the catalog. Backends that don’t maintain a catalog return CreateIndexError::Unsupported.

if_not_exists collapses both name and schema-equivalence conflicts into CreateIndexOutcome::NoOpExists instead of surfacing them as errors.

Source

fn drop_index( &mut self, _name: &str, _if_exists: bool, ) -> Result<DropIndexOutcome, DropIndexError>

Remove an explicitly-declared index from the catalog. Backends without catalog support return DropIndexError::Unsupported. if_exists collapses missing-index errors into DropIndexOutcome::NoOpMissing.

Source

fn create_constraint( &mut self, _request: ConstraintRequest, _if_not_exists: bool, ) -> Result<CreateConstraintOutcome, CreateConstraintError>

Register an explicitly-declared constraint. Backends without catalog support return CreateConstraintError::Unsupported. Uniqueness/key kinds may transparently register a backing range index of the same name.

Source

fn drop_constraint( &mut self, _name: &str, _if_exists: bool, ) -> Result<DropConstraintOutcome, DropConstraintError>

Drop a named constraint. Cascades to the backing index if the constraint owned one.

Source

fn replace_node_properties( &mut self, node_id: NodeId, properties: Properties, ) -> bool
where Self: Sized,

Source

fn merge_node_properties( &mut self, node_id: NodeId, properties: Properties, ) -> bool

Source

fn set_node_labels(&mut self, node_id: NodeId, labels: Vec<String>) -> bool
where Self: Sized,

Source

fn replace_relationship_properties( &mut self, rel_id: RelationshipId, properties: Properties, ) -> bool
where Self: Sized,

Source

fn merge_relationship_properties( &mut self, rel_id: RelationshipId, properties: Properties, ) -> bool

Source

fn delete_relationships_of( &mut self, node_id: NodeId, direction: Direction, ) -> usize

Source

fn get_or_create_node( &mut self, labels: Vec<String>, match_key: &str, match_value: &PropertyValue, init_properties: Properties, ) -> NodeRecord
where Self: Sized,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§