pub struct SimpleConnectionEstablishmentManager { /* private fields */ }
Expand description
Simplified connection establishment manager
Implementations§
Source§impl SimpleConnectionEstablishmentManager
impl SimpleConnectionEstablishmentManager
Sourcepub fn new(
config: SimpleEstablishmentConfig,
discovery_manager: Arc<Mutex<CandidateDiscoveryManager>>,
bootstrap_nodes: Vec<BootstrapNode>,
event_callback: Option<Box<dyn Fn(SimpleConnectionEvent) + Send + Sync>>,
) -> Self
pub fn new( config: SimpleEstablishmentConfig, discovery_manager: Arc<Mutex<CandidateDiscoveryManager>>, bootstrap_nodes: Vec<BootstrapNode>, event_callback: Option<Box<dyn Fn(SimpleConnectionEvent) + Send + Sync>>, ) -> Self
Create a new simplified connection establishment manager
Sourcepub fn connect_to_peer(
&mut self,
peer_id: PeerId,
known_addresses: Vec<SocketAddr>,
) -> Result<(), String>
pub fn connect_to_peer( &mut self, peer_id: PeerId, known_addresses: Vec<SocketAddr>, ) -> Result<(), String>
Start connection to peer
Sourcepub fn poll(&mut self, now: Instant) -> Vec<SimpleConnectionEvent>
pub fn poll(&mut self, now: Instant) -> Vec<SimpleConnectionEvent>
Poll for progress
Sourcepub fn cancel_connection(&mut self, peer_id: PeerId) -> bool
pub fn cancel_connection(&mut self, peer_id: PeerId) -> bool
Cancel connection attempt
Auto Trait Implementations§
impl Freeze for SimpleConnectionEstablishmentManager
impl !RefUnwindSafe for SimpleConnectionEstablishmentManager
impl Send for SimpleConnectionEstablishmentManager
impl Sync for SimpleConnectionEstablishmentManager
impl Unpin for SimpleConnectionEstablishmentManager
impl !UnwindSafe for SimpleConnectionEstablishmentManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more