Trait graphannis::graph::GraphStorage [−][src]
pub trait GraphStorage: EdgeContainer {
fn find_connected(
&'a self,
node: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = u64> + 'a, Global>;
fn find_connected_inverse(
&'a self,
node: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = u64> + 'a, Global>;
fn distance(&self, source: u64, target: u64) -> Option<usize>;
fn is_connected(
&self,
source: u64,
target: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> bool;
fn get_anno_storage(&self) -> &dyn AnnotationStorage<Edge>;
fn copy(
&mut self,
node_annos: &dyn AnnotationStorage<u64>,
orig: &dyn GraphStorage
) -> Result<(), GraphAnnisCoreError>;
fn as_edgecontainer(&self) -> &dyn EdgeContainer;
fn serialization_id(&self) -> String;
fn load_from(location: &Path) -> Result<Self, GraphAnnisCoreError>;
fn save_to(&self, location: &Path) -> Result<(), GraphAnnisCoreError>;
fn as_writeable(&mut self) -> Option<&mut dyn WriteableGraphStorage> { ... }
fn inverse_has_same_cost(&self) -> bool { ... }
}
Expand description
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
Find all nodes reachable from a given start node inside the component.
Find all nodes reachable from a given start node inside the component, when the directed edges are inversed.
Compute the distance (shortest path length) of two nodes inside this component.
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>
fn get_anno_storage(&self) -> &dyn AnnotationStorage<Edge>
Get the annotation storage for the edges of this graph storage.
fn copy(
&mut self,
node_annos: &dyn AnnotationStorage<u64>,
orig: &dyn GraphStorage
) -> Result<(), GraphAnnisCoreError>
fn copy(
&mut self,
node_annos: &dyn AnnotationStorage<u64>,
orig: &dyn GraphStorage
) -> Result<(), GraphAnnisCoreError>
Copy the content of another component. This removes the existing content of this graph storage.
fn as_edgecontainer(&self) -> &dyn EdgeContainer
fn as_edgecontainer(&self) -> &dyn EdgeContainer
Upcast this graph storage to the EdgeContainer trait.
fn serialization_id(&self) -> String
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 load_from(location: &Path) -> Result<Self, GraphAnnisCoreError>
fn load_from(location: &Path) -> Result<Self, GraphAnnisCoreError>
Load the graph storage from a location
on the disk. This location is a directory, which can contain files specific to this graph storage.
Provided methods
fn as_writeable(&mut self) -> Option<&mut dyn WriteableGraphStorage>
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
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.
Implementations on Foreign Types
pub fn load_from(
location: &Path
) -> Result<AdjacencyListStorage, GraphAnnisCoreError> where
AdjacencyListStorage: Sized,
AdjacencyListStorage: for<'de> Deserialize<'de>,
pub fn find_connected(
&'a self,
node: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = u64> + 'a, Global>
pub fn find_connected_inverse(
&'a self,
node: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = u64> + 'a, Global>
pub fn is_connected(
&self,
source: u64,
target: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> bool
pub fn copy(
&mut self,
_node_annos: &dyn AnnotationStorage<u64>,
orig: &dyn GraphStorage
) -> Result<(), GraphAnnisCoreError>
impl<OrderT, LevelT> GraphStorage for PrePostOrderStorage<OrderT, LevelT> where
OrderT: 'static + NumValue + for<'de> Deserialize<'de> + Serialize,
LevelT: 'static + NumValue + for<'de> Deserialize<'de> + Serialize,
impl<OrderT, LevelT> GraphStorage for PrePostOrderStorage<OrderT, LevelT> where
OrderT: 'static + NumValue + for<'de> Deserialize<'de> + Serialize,
LevelT: 'static + NumValue + for<'de> Deserialize<'de> + Serialize,
pub fn load_from(
location: &Path
) -> Result<PrePostOrderStorage<OrderT, LevelT>, GraphAnnisCoreError> where
PrePostOrderStorage<OrderT, LevelT>: Sized,
PrePostOrderStorage<OrderT, LevelT>: for<'de> Deserialize<'de>,
pub fn find_connected(
&'a self,
node: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = u64> + 'a, Global>
pub fn find_connected_inverse(
&'a self,
start_node: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = u64> + 'a, Global>
pub fn is_connected(
&self,
source: u64,
target: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> bool
pub fn copy(
&mut self,
node_annos: &dyn AnnotationStorage<u64>,
orig: &dyn GraphStorage
) -> Result<(), GraphAnnisCoreError>
pub fn load_from(
location: &Path
) -> Result<DiskAdjacencyListStorage, GraphAnnisCoreError> where
DiskAdjacencyListStorage: Sized,
pub fn find_connected(
&'a self,
node: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = u64> + 'a, Global>
pub fn find_connected_inverse(
&'a self,
node: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = u64> + 'a, Global>
pub fn is_connected(
&self,
source: u64,
target: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> bool
pub fn copy(
&mut self,
_node_annos: &dyn AnnotationStorage<u64>,
orig: &dyn GraphStorage
) -> Result<(), GraphAnnisCoreError>
impl<PosT> GraphStorage for LinearGraphStorage<PosT> where
PosT: 'static + NumValue + for<'de> Deserialize<'de> + Serialize,
impl<PosT> GraphStorage for LinearGraphStorage<PosT> where
PosT: 'static + NumValue + for<'de> Deserialize<'de> + Serialize,
pub fn load_from(
location: &Path
) -> Result<LinearGraphStorage<PosT>, GraphAnnisCoreError> where
LinearGraphStorage<PosT>: Sized,
LinearGraphStorage<PosT>: for<'de> Deserialize<'de>,
pub fn find_connected(
&'a self,
source: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = u64> + 'a, Global>
pub fn find_connected_inverse(
&'a self,
source: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> Box<dyn Iterator<Item = u64> + 'a, Global>
pub fn is_connected(
&self,
source: u64,
target: u64,
min_distance: usize,
max_distance: Bound<usize>
) -> bool
pub fn copy(
&mut self,
node_annos: &dyn AnnotationStorage<u64>,
orig: &dyn GraphStorage
) -> Result<(), GraphAnnisCoreError>
Return an identifier for this graph storage which is used to distinguish the different graph storages when (de-) serialized.