pub struct FakeHeaderConfig { /* private fields */ }Expand description
Fake body generation mode.
Each mode defines how fake body content is generated to pad packets.
Uses Vec
Implementations§
Source§impl FakeHeaderConfig
impl FakeHeaderConfig
pub fn new(pattern: Vec<FieldTypeHolder>) -> Self
Sourcepub fn random<AE: AsyncExecutor>(settings: &Settings<AE>) -> Self
pub fn random<AE: AsyncExecutor>(settings: &Settings<AE>) -> Self
Create a random header configuration drawn from the default probability distributions.
Includes a header with probability FAKE_HEADER_PROBABILITY; if included, a random number
of fields are packed to fill a length sampled from [FAKE_HEADER_LENGTH_MIN, FAKE_HEADER_LENGTH_MAX].
Each field is independently assigned one of the five FieldType variants weighted by the
FAKE_HEADER_FIELD_WEIGHT_* settings.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn fill(&mut self, buffer: DynamicByteBuffer)
Trait Implementations§
Source§impl Clone for FakeHeaderConfig
impl Clone for FakeHeaderConfig
Source§fn clone(&self) -> FakeHeaderConfig
fn clone(&self) -> FakeHeaderConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FakeHeaderConfig
impl RefUnwindSafe for FakeHeaderConfig
impl Send for FakeHeaderConfig
impl Sync for FakeHeaderConfig
impl Unpin for FakeHeaderConfig
impl UnsafeUnpin for FakeHeaderConfig
impl UnwindSafe for FakeHeaderConfig
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