Trait graphannis::graph::WriteableGraphStorage

source ·
pub trait WriteableGraphStorage: GraphStorage {
    // Required methods
    fn add_edge(&mut self, edge: Edge) -> Result<(), GraphAnnisCoreError>;
    fn add_edge_annotation(
        &mut self,
        edge: Edge,
        anno: Annotation
    ) -> Result<(), GraphAnnisCoreError>;
    fn delete_edge(&mut self, edge: &Edge) -> Result<(), GraphAnnisCoreError>;
    fn delete_edge_annotation(
        &mut self,
        edge: &Edge,
        anno_key: &AnnoKey
    ) -> Result<(), GraphAnnisCoreError>;
    fn delete_node(&mut self, node: u64) -> Result<(), GraphAnnisCoreError>;
    fn calculate_statistics(&mut self) -> Result<(), GraphAnnisCoreError>;
    fn clear(&mut self) -> Result<(), GraphAnnisCoreError>;
}
Expand description

Trait for accessing graph storages which can be written to.

Required Methods§

source

fn add_edge(&mut self, edge: Edge) -> Result<(), GraphAnnisCoreError>

Add an edge to this graph storage.

source

fn add_edge_annotation( &mut self, edge: Edge, anno: Annotation ) -> Result<(), GraphAnnisCoreError>

Add an annotation to an edge in this graph storage. The edge has to exist.

source

fn delete_edge(&mut self, edge: &Edge) -> Result<(), GraphAnnisCoreError>

Delete an existing edge.

source

fn delete_edge_annotation( &mut self, edge: &Edge, anno_key: &AnnoKey ) -> Result<(), GraphAnnisCoreError>

Delete the annotation (defined by the qualified annotation name in anno_key) for an edge.

source

fn delete_node(&mut self, node: u64) -> Result<(), GraphAnnisCoreError>

Delete a node from this graph storage. This deletes both edges edges where the node is the source or the target node.

source

fn calculate_statistics(&mut self) -> Result<(), GraphAnnisCoreError>

Re-calculate the statistics of this graph storage.

source

fn clear(&mut self) -> Result<(), GraphAnnisCoreError>

Remove all edges from this grap storage.

Implementors§