pub struct ByzantineTransport { /* private fields */ }Expand description
Message-level interceptor that applies per-party behaviors.
Construct with ByzantineTransport::new (or
ByzantineTransport::from_specs) and call
ByzantineTransport::route with each batch of outgoing messages
for one round. The returned Vec<Message> is what the recipients
actually see.
The wrapper owns a small per-party history so the Replay behavior
can resurface the previous round’s traffic.
Implementations§
Source§impl ByzantineTransport
impl ByzantineTransport
pub fn new() -> Self
pub fn from_specs(specs: Vec<BehaviorSpec>) -> Self
Sourcepub fn set(&mut self, spec: BehaviorSpec)
pub fn set(&mut self, spec: BehaviorSpec)
Configure (or replace) the behavior for party_id.
Sourcepub fn behavior_for(&self, party_id: &str) -> PeerBehavior
pub fn behavior_for(&self, party_id: &str) -> PeerBehavior
Look up the configured behavior for a party; defaults to Honest.
Trait Implementations§
Source§impl Debug for ByzantineTransport
impl Debug for ByzantineTransport
Source§impl Default for ByzantineTransport
impl Default for ByzantineTransport
Source§fn default() -> ByzantineTransport
fn default() -> ByzantineTransport
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ByzantineTransport
impl RefUnwindSafe for ByzantineTransport
impl Send for ByzantineTransport
impl Sync for ByzantineTransport
impl Unpin for ByzantineTransport
impl UnsafeUnpin for ByzantineTransport
impl UnwindSafe for ByzantineTransport
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