pub struct Direct { /* private fields */ }Implementations§
Source§impl Direct
impl Direct
pub const ALPN: &[u8] = b"/iroh/lan-direct/1"
pub fn new(endpoint: Endpoint, direct_connect_tx: Sender<DirectMessage>) -> Self
pub async fn handle_connection(&self, conn: Connection) -> Result<()>
pub async fn route_packet(&self, to: NodeId, pkg: DirectMessage) -> Result<()>
pub async fn get_endpoint(&self) -> Endpoint
pub async fn get_conn_state(&self, node_id: NodeId) -> Result<ConnState>
pub async fn close(&self) -> Result<()>
Trait Implementations§
Source§impl ProtocolHandler for Direct
impl ProtocolHandler for Direct
Source§async fn accept(&self, connection: Connection) -> Result<(), AcceptError>
async fn accept(&self, connection: Connection) -> Result<(), AcceptError>
Handle an incoming connection. Read more
Source§fn on_connecting(
&self,
connecting: Connecting,
) -> impl Future<Output = Result<Connection, AcceptError>> + Send
fn on_connecting( &self, connecting: Connecting, ) -> impl Future<Output = Result<Connection, AcceptError>> + Send
Optional interception point to handle the
Connecting state. Read moreAuto Trait Implementations§
impl Freeze for Direct
impl RefUnwindSafe for Direct
impl Send for Direct
impl Sync for Direct
impl Unpin for Direct
impl UnwindSafe for Direct
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