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
sourceimpl FullMeshPeeringStrategy
impl FullMeshPeeringStrategy
sourcepub fn new(
netapp: Arc<NetApp>,
bootstrap_list: Vec<(NodeID, SocketAddr)>,
our_addr: Option<SocketAddr>
) -> Arc<Self>
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.
sourcepub async fn run(self: Arc<Self>, must_exit: Receiver<bool>)
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.
sourcepub fn get_peer_list(&self) -> Arc<Vec<PeerInfo>>
pub fn get_peer_list(&self) -> Arc<Vec<PeerInfo>>
Returns a list of currently known peers in the network.
sourcepub fn set_ping_timeout_millis(&self, timeout: u64)
pub fn set_ping_timeout_millis(&self, timeout: u64)
Set the timeout for ping messages, in milliseconds
Auto Trait Implementations
impl !RefUnwindSafe for FullMeshPeeringStrategy
impl Send for FullMeshPeeringStrategy
impl Sync for FullMeshPeeringStrategy
impl Unpin for FullMeshPeeringStrategy
impl !UnwindSafe for FullMeshPeeringStrategy
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more