pub struct Endpoint { /* private fields */ }
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub async fn new(
addr: &str,
port: u16,
name: &str,
mode: Mode,
) -> Result<Arc<Self>>
pub async fn new( addr: &str, port: u16, name: &str, mode: Mode, ) -> Result<Arc<Self>>
Create a new endpoint on an interface and port
pub async fn stop(&self)
Sourcepub async fn add_peers(&self, peers: Vec<String>) -> Result<()>
pub async fn add_peers(&self, peers: Vec<String>) -> Result<()>
Insert a set of peers into the routing table
Each peer will spawn a worker that periodically attempts to connect to it. Connections might not be recipricated if the peer doesn’t know the local IP or is rejecting unknown connections.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Endpoint
impl !RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl !UnwindSafe for Endpoint
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