[][src]Trait poldercast::Layer

pub trait Layer {
    fn alias(&self) -> &'static str;
fn reset(&mut self);
fn populate(&mut self, identity: &NodeProfile, all_nodes: &Nodes);
fn view(&mut self, view: &mut ViewBuilder, all_nodes: &mut Nodes);
fn gossips(
        &mut self,
        identity: &NodeProfile,
        gossips: &mut GossipsBuilder,
        all_nodes: &Nodes
    ); }

Required methods

fn alias(&self) -> &'static str

alias to the layer, for information purpose

fn reset(&mut self)

reset the layer state

fn populate(&mut self, identity: &NodeProfile, all_nodes: &Nodes)

populate the Layer based on all the nodes. The NodeProfile is given as the identity of the local node, allowing access to the local PublicId or Subscriptions (for example, used in the Rings or Vicinity module).

fn view(&mut self, view: &mut ViewBuilder, all_nodes: &mut Nodes)

based on the populated layer, provide nodes to the ViewBuilder.

fn gossips(
    &mut self,
    identity: &NodeProfile,
    gossips: &mut GossipsBuilder,
    all_nodes: &Nodes
)

update the GossipsBuilder, effectively preparing the list of gossips to share with the recipient (see GossipsBuilder). To build the gossips the Layer has access to the whole list of known Nodes.

Loading content...

Implementors

impl Layer for RandomDirectConnections[src]

impl Layer for Cyclon[src]

impl Layer for Rings[src]

impl Layer for Vicinity[src]

Loading content...