Skip to main content

Parents

Trait Parents 

Source
pub trait Parents: Send + Sync {
    // Required methods
    fn parent_names<'life0, 'async_trait>(
        &'life0 self,
        name: Vertex,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Vertex>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn hint_subdag_for_insertion<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _heads: &'life1 [Vertex],
    ) -> Pin<Box<dyn Future<Output = Result<MemDag>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn parent_names<'life0, 'async_trait>( &'life0 self, name: Vertex, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vertex>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn hint_subdag_for_insertion<'life0, 'life1, 'async_trait>( &'life0 self, _heads: &'life1 [Vertex], ) -> Pin<Box<dyn Future<Output = Result<MemDag>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

A hint of a sub-graph for inserting heads.

This is used to reduce remote fetches in a lazy graph. The function should ideally return a subset of pending vertexes that are confirmed to not overlap in the existing (potentially lazy) graph.

The pending roots will be checked first, if a root is unknown locally then all its descendants will be considered unknown locally.

The returned graph is only used to optimize network fetches in assign_head. It is not used to be actually inserted to the graph. So returning an empty or “incorrect” graph does not hurt correctness. But might hurt performance. Returning a set that contains vertexes that do overlap in the existing graph is incorrect.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Parents for Arc<dyn DagAlgorithm + Send + Sync>

Source§

fn parent_names<'life0, 'async_trait>( &'life0 self, name: Vertex, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vertex>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn hint_subdag_for_insertion<'life0, 'life1, 'async_trait>( &'life0 self, heads: &'life1 [Vertex], ) -> Pin<Box<dyn Future<Output = Result<MemDag>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl Parents for HashMap<Vertex, Vec<Vertex>>

Source§

fn parent_names<'life0, 'async_trait>( &'life0 self, name: Vertex, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vertex>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn hint_subdag_for_insertion<'life0, 'life1, 'async_trait>( &'life0 self, heads: &'life1 [Vertex], ) -> Pin<Box<dyn Future<Output = Result<MemDag>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl<'a> Parents for Box<dyn Fn(Vertex) -> Result<Vec<Vertex>> + Send + Sync + 'a>

Source§

fn parent_names<'life0, 'async_trait>( &'life0 self, name: Vertex, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vertex>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn hint_subdag_for_insertion<'life0, 'life1, 'async_trait>( &'life0 self, _heads: &'life1 [Vertex], ) -> Pin<Box<dyn Future<Output = Result<MemDag>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§