pub struct FullMeshPeeringStrategy { /* private fields */ }
Expand description

A “Full Mesh” peering strategy is a peering strategy that tries to establish and maintain a direct connection with all of the known nodes in the network.

Implementations§

source§

impl FullMeshPeeringStrategy

source

pub fn new( netapp: Arc<NetApp>, bootstrap_list: Vec<(NodeID, SocketAddr)>, our_addr: Option<SocketAddr> ) -> Arc<Self>

Create a new Full Mesh peering strategy. The strategy will not be run until .run() is called and awaited. Once that happens, the peering strategy will try to connect to all of the nodes specified in the bootstrap list.

source

pub async fn run(self: Arc<Self>, must_exit: Receiver<bool>)

Run the full mesh peering strategy. This future exits when the must_exit watch becomes true.

source

pub fn get_peer_list(&self) -> Arc<Vec<PeerInfo>>

Returns a list of currently known peers in the network.

source

pub fn set_ping_timeout_millis(&self, timeout: u64)

Set the timeout for ping messages, in milliseconds

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, M> StreamingEndpointHandler<M> for Twhere T: EndpointHandler<M>, M: Message,

source§

fn handle<'life0, 'async_trait>( self: &'life0 Arc<T, Global>, m: Req<M>, from: PublicKey ) -> Pin<Box<dyn Future<Output = Resp<M>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, T: 'async_trait,

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V