[][src]Trait graphannis::graph::GraphStorage

pub trait GraphStorage: EdgeContainer {
    fn find_connected<'a>(
        &'a self,
        node: NodeID,
        min_distance: usize,
        max_distance: Bound<usize>
    ) -> Box<dyn Iterator<Item = NodeID> + 'a>;
fn find_connected_inverse<'a>(
        &'a self,
        node: NodeID,
        min_distance: usize,
        max_distance: Bound<usize>
    ) -> Box<dyn Iterator<Item = NodeID> + 'a>;
fn distance(&self, source: &NodeID, target: &NodeID) -> Option<usize>;
fn is_connected(
        &self,
        source: &NodeID,
        target: &NodeID,
        min_distance: usize,
        max_distance: Bound<usize>
    ) -> bool;
fn get_anno_storage(&self) -> &dyn AnnotationStorage<Edge>;
fn copy(&mut self, db: &Graph, orig: &dyn GraphStorage);
fn as_edgecontainer(&self) -> &dyn EdgeContainer;
fn serialization_id(&self) -> String;
fn serialize_gs(&self, writer: &mut dyn Write) -> Result<()>;
fn deserialize_gs(input: &mut dyn Read) -> Result<Self>
    where
        Self: Sized + Deserialize<'de>
; fn as_writeable(&mut self) -> Option<&mut dyn WriteableGraphStorage> { ... }
fn inverse_has_same_cost(&self) -> bool { ... } }

A graph storage is the representation of an edge component of a graph with specific structures. These specific structures are exploited to efficiently implement reachability queries.

Required methods

fn find_connected<'a>(
    &'a self,
    node: NodeID,
    min_distance: usize,
    max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = NodeID> + 'a>

Find all nodes reachable from a given start node inside the component.

fn find_connected_inverse<'a>(
    &'a self,
    node: NodeID,
    min_distance: usize,
    max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = NodeID> + 'a>

Find all nodes reachable from a given start node inside the component, when the directed edges are inversed.

fn distance(&self, source: &NodeID, target: &NodeID) -> Option<usize>

Compute the distance (shortest path length) of two nodes inside this component.

fn is_connected(
    &self,
    source: &NodeID,
    target: &NodeID,
    min_distance: usize,
    max_distance: Bound<usize>
) -> bool

Check if two nodes are connected with any path in this component given a minimum (min_distance) and maximum (max_distance) path length.

fn get_anno_storage(&self) -> &dyn AnnotationStorage<Edge>

Get the annotation storage for the edges of this graph storage.

fn copy(&mut self, db: &Graph, orig: &dyn GraphStorage)

Copy the content of another component. This removes the existing content of this graph storage.

fn as_edgecontainer(&self) -> &dyn EdgeContainer

Upcast this graph storage to the EdgeContainer trait.

fn serialization_id(&self) -> String

Return an identifier for this graph storage which is used to distinguish the different graph storages when (de-) serialized.

fn serialize_gs(&self, writer: &mut dyn Write) -> Result<()>

Serialize this graph storage.

fn deserialize_gs(input: &mut dyn Read) -> Result<Self> where
    Self: Sized + Deserialize<'de>, 

De-serialize this graph storage.

Loading content...

Provided methods

fn as_writeable(&mut self) -> Option<&mut dyn WriteableGraphStorage>

Try to downcast this graph storage to a WriteableGraphStorage trait. Returns None if this graph storage is not writable.

fn inverse_has_same_cost(&self) -> bool

If true, finding the inverse connected nodes via find_connected_inverse(...) has the same cost as the non-inverse case.

Loading content...

Implementors

Loading content...