pub struct FacePairTable { /* private fields */ }Expand description
Maps rx FaceId → tx FaceId for asymmetric link pairs (e.g., wfb-ng).
On symmetric faces (Udp, Tcp, Ethernet), Data is sent back on the same face an Interest arrived on. On asymmetric wfb-ng links, there is a separate transmit face — this table resolves which tx face to use.
The dispatch stage consults this table before sending Data:
ⓘ
let send_id = face_pairs.get_tx_for_rx(in_face_id).unwrap_or(in_face_id);
face_table.get(send_id)?.send(data).await;Normal faces have no entry in this table (get_tx_for_rx returns None),
so unwrap_or(in_face_id) falls through to the standard symmetric path.
Implementations§
Source§impl FacePairTable
impl FacePairTable
pub fn new() -> Self
Sourcepub fn insert(&self, rx: FaceId, tx: FaceId)
pub fn insert(&self, rx: FaceId, tx: FaceId)
Register an asymmetric link pair: Interests arrive on rx, Data is
sent on tx.
Sourcepub fn get_tx_for_rx(&self, rx: FaceId) -> Option<FaceId>
pub fn get_tx_for_rx(&self, rx: FaceId) -> Option<FaceId>
Returns the tx face to use when Data should go back on rx_face.
Returns None for symmetric faces.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FacePairTable
impl !RefUnwindSafe for FacePairTable
impl Send for FacePairTable
impl Sync for FacePairTable
impl Unpin for FacePairTable
impl UnwindSafe for FacePairTable
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