ocapn-netlayer 0.1.4

OCapN transport layer interfaces and types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use async_trait::async_trait;

use crate::Result;
use crate::{connection::Connection, locator::Peer};

#[async_trait]
pub trait Connector {
    /// Create a new outgoing connection to the peer locator given.
    async fn new_outgoing_connection(&mut self, locator: &Peer) -> Result<Connection>;

    /// Accept incoming connections to this peer's netlayer location.
    async fn accept_incoming_connection(&mut self) -> Result<Option<Connection>>;
}