pub struct PacketShaper { /* private fields */ }Expand description
Packet shaper that modifies traffic patterns
Implementations§
Source§impl PacketShaper
impl PacketShaper
Sourcepub fn new(strategy: ShapingStrategy) -> Self
pub fn new(strategy: ShapingStrategy) -> Self
Create new packet shaper
Sourcepub async fn next_packet(&mut self) -> Option<Bytes>
pub async fn next_packet(&mut self) -> Option<Bytes>
Get next packet to send (with shaping applied)
Sourcepub fn set_dummy_traffic(&mut self, enabled: bool)
pub fn set_dummy_traffic(&mut self, enabled: bool)
Enable/disable dummy traffic
Sourcepub fn set_strategy(&mut self, strategy: ShapingStrategy)
pub fn set_strategy(&mut self, strategy: ShapingStrategy)
Change shaping strategy
Sourcepub fn stats(&self) -> &ShapingStats
pub fn stats(&self) -> &ShapingStats
Get current statistics
Sourcepub fn clear_queue(&mut self)
pub fn clear_queue(&mut self)
Clear queue
Auto Trait Implementations§
impl Freeze for PacketShaper
impl RefUnwindSafe for PacketShaper
impl Send for PacketShaper
impl Sync for PacketShaper
impl Unpin for PacketShaper
impl UnsafeUnpin for PacketShaper
impl UnwindSafe for PacketShaper
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