pub struct MockConfig {
pub drop_all: bool,
pub tamper: bool,
}Expand description
Fault-injection knobs for a mock channel.
Fields§
§drop_all: boolIf true, every sent message is silently discarded and the
receiver observes a crate::error::Error::MockDrop.
tamper: boolIf true, every sent message has its bytes XORed with 0xFF
before delivery, simulating an active tampering adversary.
Implementations§
Source§impl MockConfig
impl MockConfig
Sourcepub fn install(name: &str, cfg: MockConfig)
pub fn install(name: &str, cfg: MockConfig)
Install a configuration for the named channel. Must be called before either end connects so both halves observe it.
Trait Implementations§
Source§impl Clone for MockConfig
impl Clone for MockConfig
Source§fn clone(&self) -> MockConfig
fn clone(&self) -> MockConfig
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 moreSource§impl Debug for MockConfig
impl Debug for MockConfig
Source§impl Default for MockConfig
impl Default for MockConfig
Source§fn default() -> MockConfig
fn default() -> MockConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MockConfig
impl RefUnwindSafe for MockConfig
impl Send for MockConfig
impl Sync for MockConfig
impl Unpin for MockConfig
impl UnsafeUnpin for MockConfig
impl UnwindSafe for MockConfig
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