pub trait GraphStorageMut: GraphStorage {
Show 23 methods
// Required methods
fn create_node(
&mut self,
labels: Vec<String>,
properties: Properties,
) -> 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_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§
fn create_node( &mut self, labels: Vec<String>, properties: Properties, ) -> 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
Sourcefn delete_node(&mut self, node_id: NodeId) -> bool
fn delete_node(&mut self, node_id: NodeId) -> bool
Returns false if the node still has attached relationships.
Sourcefn detach_delete_node(&mut self, node_id: NodeId) -> bool
fn detach_delete_node(&mut self, node_id: NodeId) -> bool
Deletes the node and all attached relationships.
Sourcefn clear(&mut self)
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§
Sourcefn create_index(
&mut self,
_request: IndexRequest,
_if_not_exists: bool,
) -> Result<CreateIndexOutcome, CreateIndexError>
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.
Sourcefn drop_index(
&mut self,
_name: &str,
_if_exists: bool,
) -> Result<DropIndexOutcome, DropIndexError>
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.
Sourcefn create_constraint(
&mut self,
_request: ConstraintRequest,
_if_not_exists: bool,
) -> Result<CreateConstraintOutcome, CreateConstraintError>
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.
Sourcefn drop_constraint(
&mut self,
_name: &str,
_if_exists: bool,
) -> Result<DropConstraintOutcome, DropConstraintError>
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.