pub struct InProcFace { /* private fields */ }Expand description
In-process NDN face backed by a pair of tokio::sync::mpsc channels.
InProcFace is held by the forwarder pipeline; InProcHandle is given
to the application (library user). The forwarder sends packets to the app
via InProcFace::send → app_tx; the app sends packets to the forwarder
via InProcHandle::send → face_tx.
pipeline application
──────── ───────────
InProcFace::recv() ← InProcHandle::send() (face_rx ← face_tx)
InProcFace::send() → InProcHandle::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§
Source§impl InProcFace
impl InProcFace
Sourcepub fn new(id: FaceId, buffer: usize) -> (Self, InProcHandle)
pub fn new(id: FaceId, buffer: usize) -> (Self, InProcHandle)
Create a linked (InProcFace, InProcHandle) pair with buffer slots each.
Trait Implementations§
Source§impl Face for InProcFace
impl Face for InProcFace
Source§async fn recv(&self) -> Result<Bytes, FaceError>
async fn recv(&self) -> Result<Bytes, FaceError>
Receive a packet sent by the application via InProcHandle::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 InProcHandle::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.Source§fn local_uri(&self) -> Option<String>
fn local_uri(&self) -> Option<String>
Local URI (e.g.
unix:///run/nfd/nfd.sock). Returns None for face
types that don’t expose local binding info.Auto Trait Implementations§
impl !Freeze for InProcFace
impl !RefUnwindSafe for InProcFace
impl Send for InProcFace
impl Sync for InProcFace
impl Unpin for InProcFace
impl UnwindSafe for InProcFace
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