[][src]Struct poldercast::Topology

pub struct Topology { /* fields omitted */ }

Implementations

impl Topology[src]

pub fn new(address: SocketAddr, id: &SecretKey) -> Self[src]

create a Topology for the given profile

pub fn new_with<LB>(address: SocketAddr, id: &SecretKey, builder: LB) -> Self where
    LB: LayerBuilder
[src]

pub fn update_profile_subscriptions(&mut self, id: &SecretKey)[src]

pub fn subscribe_topic(&mut self, topic: Topic)[src]

subscribe to the given topic

this function also update our profile

pub fn unsubscribe_topic(&mut self, topic: &Topic)[src]

unsubscribe to the given topic

this function also update our profile

pub fn remove_peer(&mut self, id: &PublicKey)[src]

call this function if you could not establish an handshake from this peer. This will prevent to use it in the next profile update.

The node will be removed from our layers, but it will not be entirely from our profile pool. We may share it to other nodes we may find it relevant

pub fn promote_peer(&mut self, id: &PublicKey)[src]

call this function to validate you were able to connect with the given peer. This will help the system make sure this entry is kept and reuse

Call this function every time you successfully establish an handshake

pub fn add_peer(&mut self, peer: Profile) -> bool[src]

add a Peer to the Topology

the peer will be considered automatically for all our layers. If the peer seem appropriate it will be added to the view and we will attempt to connect to it later.

However, if the peer was already demoted some times (i.e. the peer was already known and we already know we cannot connect to it for now, it will be required to be "forgotten" or to be "promoted" in order to move away from the naughty list).

pub fn gossips_for(&mut self, recipient: &PublicKey) -> Vec<Gossip>[src]

pub fn view(
    &mut self,
    from: Option<&PublicKey>,
    selection: Selection
) -> Vec<Arc<Profile>>
[src]

pub fn get(&mut self, id: &PublicKey) -> Option<&Arc<Profile>>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,