pub struct EnterGuard { /* private fields */ }Implementations§
Source§impl EnterGuard
impl EnterGuard
Sourcepub fn egress_all(&self, out: &mut Vec<Packet>)
pub fn egress_all(&self, out: &mut Vec<Packet>)
Drain every host’s outbound queue into out. The caller decides
what happens next — typically: consult rules via
EnterGuard::evaluate for each packet and then
EnterGuard::deliver (or schedule for later). The buffer is
passed in so the caller can reuse its allocation across ticks.
See fixture for the default tokio-driven loop.
Sourcepub fn deliver(&self, pkt: Packet)
pub fn deliver(&self, pkt: Packet)
Route a packet to the host owning its destination IP. Drops silently if no host is registered for that IP.
Sourcepub fn evaluate(&self, pkt: &Packet) -> Verdict
pub fn evaluate(&self, pkt: &Packet) -> Verdict
Walk installed rules for pkt. First non-Pass verdict wins;
empty rule chain returns Verdict::Pass.
Sourcepub fn set_current(&self, id: HostId)
pub fn set_current(&self, id: HostId)
Pin which host subsequent sys() calls (i.e. socket syscalls
from any task spawned inside this guard) talk to.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EnterGuard
impl RefUnwindSafe for EnterGuard
impl Send for EnterGuard
impl Sync for EnterGuard
impl Unpin for EnterGuard
impl UnsafeUnpin for EnterGuard
impl UnwindSafe for EnterGuard
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