Trait s2n_quic_core::havoc::Strategy
source · [−]pub trait Strategy: Sized {
fn havoc<R: Random>(&mut self, rand: &mut R, buffer: &mut EncoderBuffer<'_>);
fn havoc_slice<R: Random>(
&mut self,
rand: &mut R,
buffer: &mut [u8]
) -> usize { ... }
fn alternate<B: Strategy>(
self,
b: B,
period: Range<usize>
) -> Alternate<Self, B> { ... }
fn repeat(self, count: Range<usize>) -> Repeat<Self> { ... }
fn randomly(self) -> Randomly<Self> { ... }
fn toggle(self, period: Range<usize>) -> Toggle<Self> { ... }
fn and_then<B: Strategy>(self, b: B) -> AndThen<Self, B> { ... }
fn while_has_capacity(self) -> WhileHasCapacity<Self> { ... }
}Required Methods
fn havoc<R: Random>(&mut self, rand: &mut R, buffer: &mut EncoderBuffer<'_>)
fn havoc<R: Random>(&mut self, rand: &mut R, buffer: &mut EncoderBuffer<'_>)
Applies the havoc strategy to the supplied buffer
Provided Methods
Applies the havoc strategy to the supplied buffer slice and returns the new buffer length
Alternate between two strategies with the supplied period
Toggle the strategy on and off for the supplied period
fn while_has_capacity(self) -> WhileHasCapacity<Self>
fn while_has_capacity(self) -> WhileHasCapacity<Self>
Repeatedly applies the strategy as long as the buffer has capacity