pub struct AppFace { /* private fields */ }Expand description
In-process NDN face backed by a pair of tokio::sync::mpsc channels.
AppFace is held by the forwarder pipeline; AppHandle is given to the
application (library user). The forwarder sends packets to the app via
AppFace::send → app_tx; the app sends packets to the forwarder via
AppHandle::send → face_tx.
pipeline application
──────── ───────────
AppFace::recv() ← AppHandle::send() (face_rx ← face_tx)
AppFace::send() → AppHandle::recv() (app_tx → app_rx)face_rx is wrapped in a Mutex to satisfy the &self requirement of the
Face trait; the pipeline’s single-consumer contract means it never
actually contends.
Implementations§
Trait Implementations§
Source§impl Face for AppFace
impl Face for AppFace
Source§async fn recv(&self) -> Result<Bytes, FaceError>
async fn recv(&self) -> Result<Bytes, FaceError>
Receive a packet sent by the application via AppHandle::send.
Source§async fn send(&self, pkt: Bytes) -> Result<(), FaceError>
async fn send(&self, pkt: Bytes) -> Result<(), FaceError>
Forward a packet to the application (readable via AppHandle::recv).
fn id(&self) -> FaceId
fn kind(&self) -> FaceKind
Source§fn remote_uri(&self) -> Option<String>
fn remote_uri(&self) -> Option<String>
Remote URI (e.g.
udp4://192.168.1.1:6363). Returns None for face
types that don’t have a meaningful remote endpoint.Auto Trait Implementations§
impl !Freeze for AppFace
impl !RefUnwindSafe for AppFace
impl Send for AppFace
impl Sync for AppFace
impl Unpin for AppFace
impl UnwindSafe for AppFace
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