Trait EntryEngine

Source
pub trait EntryEngine<V> {
    type EntryRef<'i>: Deref<Target = V>
       where Self: 'i;
    type EntryMut<'i>: DerefMut<Target = V>
       where Self: 'i;

    // Required methods
    fn get_entry<'i, Q>(&'i self, query: Q) -> V
       where Q: Into<Query>;
    fn try_entry<'i, Q>(
        &'i self,
        query: Q,
    ) -> Result<Self::EntryRef<'i>, GraphError>
       where Q: Into<Query>;
    fn mut_entry<'i, Q>(
        &'i mut self,
        query: Q,
    ) -> Result<Self::EntryMut<'i>, GraphError>
       where Q: Into<Query>;

    // Provided methods
    fn set_entry<'i, Q>(
        &'i mut self,
        query: Q,
        entry: V,
    ) -> Result<(), GraphError>
       where Q: Into<Query> { ... }
    fn get_node_data<'i>(&'i self, node: usize) -> V { ... }
    fn try_node_data<'i>(&'i self, node: usize) -> Option<Self::EntryRef<'i>> { ... }
    fn mut_node_data<'i>(
        &'i mut self,
        node: usize,
    ) -> Option<Self::EntryMut<'i>> { ... }
    fn set_node_data<'i>(&'i mut self, node: usize, data: V) { ... }
    fn get_edge_data<'i>(&'i self, edge: usize) -> V { ... }
    fn try_edge_data<'i>(&'i self, edge: usize) -> Option<Self::EntryRef<'i>> { ... }
    fn mut_edge_data<'i>(
        &'i mut self,
        edge: usize,
    ) -> Option<Self::EntryMut<'i>> { ... }
    fn set_edge_data<'i>(&'i mut self, edge: usize, data: V) { ... }
}

Required Associated Types§

Source

type EntryRef<'i>: Deref<Target = V> where Self: 'i

Source

type EntryMut<'i>: DerefMut<Target = V> where Self: 'i

Required Methods§

Source

fn get_entry<'i, Q>(&'i self, query: Q) -> V
where Q: Into<Query>,

Get the reference of data by given query from the storage.

§Examples
use graph_theory::GraphEngine;
Source

fn try_entry<'i, Q>( &'i self, query: Q, ) -> Result<Self::EntryRef<'i>, GraphError>
where Q: Into<Query>,

Get the reference of data by given query from the storage.

§Examples
use graph_theory::GraphEngine;
Source

fn mut_entry<'i, Q>( &'i mut self, query: Q, ) -> Result<Self::EntryMut<'i>, GraphError>
where Q: Into<Query>,

Get the reference of data by given query from the storage.

§Examples
use graph_theory::GraphEngine;

Provided Methods§

Source

fn set_entry<'i, Q>(&'i mut self, query: Q, entry: V) -> Result<(), GraphError>
where Q: Into<Query>,

Get the reference of data by given query from the storage.

§Examples
use graph_theory::GraphEngine;
Source

fn get_node_data<'i>(&'i self, node: usize) -> V

Source

fn try_node_data<'i>(&'i self, node: usize) -> Option<Self::EntryRef<'i>>

Source

fn mut_node_data<'i>(&'i mut self, node: usize) -> Option<Self::EntryMut<'i>>

Source

fn set_node_data<'i>(&'i mut self, node: usize, data: V)

Source

fn get_edge_data<'i>(&'i self, edge: usize) -> V

Source

fn try_edge_data<'i>(&'i self, edge: usize) -> Option<Self::EntryRef<'i>>

Source

fn mut_edge_data<'i>(&'i mut self, edge: usize) -> Option<Self::EntryMut<'i>>

Source

fn set_edge_data<'i>(&'i mut self, edge: usize, data: V)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<V> EntryEngine<V> for ListStorage<V>
where V: Clone,

Source§

type EntryRef<'i> = &'i V where V: 'i

Source§

type EntryMut<'i> = &'i mut V where V: 'i