pub struct PacketReceiver { /* private fields */ }Implementations§
Source§impl PacketReceiver
impl PacketReceiver
pub fn new(window_size: Option<usize>) -> Self
Sourcepub fn observe(&mut self, packet: &Packet, now: &str) -> PacketReceiverDecision
pub fn observe(&mut self, packet: &Packet, now: &str) -> PacketReceiverDecision
Check + record a packet. Pure decision; if you call this twice
with the same packet, the second call returns Replay.
Sourcepub fn expire_older_than(&mut self, before: &str) -> usize
pub fn expire_older_than(&mut self, before: &str) -> usize
Drop entries whose recorded expires_at is < before. Useful
at start-of-tick on a receiver that wants the window to follow
real time rather than just LRU.
pub fn size(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PacketReceiver
impl RefUnwindSafe for PacketReceiver
impl Send for PacketReceiver
impl Sync for PacketReceiver
impl Unpin for PacketReceiver
impl UnsafeUnpin for PacketReceiver
impl UnwindSafe for PacketReceiver
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more