ErasedFace

Trait ErasedFace 

Source
pub trait ErasedFace:
    Send
    + Sync
    + 'static {
    // Required methods
    fn id(&self) -> FaceId;
    fn kind(&self) -> FaceKind;
    fn remote_uri(&self) -> Option<String>;
    fn local_uri(&self) -> Option<String>;
    fn send_bytes(
        &self,
        pkt: Bytes,
    ) -> Pin<Box<dyn Future<Output = Result<(), FaceError>> + Send + '_>>;
    fn recv_bytes(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<Bytes, FaceError>> + Send + '_>>;
    fn recv_bytes_with_addr(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<(Bytes, Option<FaceAddr>), FaceError>> + Send + '_>>;
}
Expand description

Object-safe wrapper around the Face trait so it can be stored in the face table.

Required Methods§

Source

fn id(&self) -> FaceId

Source

fn kind(&self) -> FaceKind

Source

fn remote_uri(&self) -> Option<String>

Source

fn local_uri(&self) -> Option<String>

Source

fn send_bytes( &self, pkt: Bytes, ) -> Pin<Box<dyn Future<Output = Result<(), FaceError>> + Send + '_>>

Source

fn recv_bytes( &self, ) -> Pin<Box<dyn Future<Output = Result<Bytes, FaceError>> + Send + '_>>

Source

fn recv_bytes_with_addr( &self, ) -> Pin<Box<dyn Future<Output = Result<(Bytes, Option<FaceAddr>), FaceError>> + Send + '_>>

Object-safe version of Face::recv_with_addr.

Returns the raw packet together with the link-layer sender address when the face type exposes it (e.g. multicast UDP). Returns None for faces that receive from a single known peer.

Implementors§

Source§

impl<F: Face> ErasedFace for F