Struct round_based::simulation::Simulation
source · pub struct Simulation<M> { /* private fields */ }Available on crate feature
dev only.Expand description
Multiparty protocol simulator
Implementations§
source§impl<M> Simulation<M>
impl<M> Simulation<M>
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Instantiates a new simulation with given capacity
Simulation stores internally all sent messages. Capacity limits size of the internal buffer.
Because of that you might run into error if you choose too small capacity. Choose capacity
that can fit all the messages sent by all the parties during entire protocol lifetime.
Default capacity is 500 (i.e. if you call Simulation::new())
sourcepub fn add_party(&mut self) -> MpcParty<M, MockedDelivery<M>>
pub fn add_party(&mut self) -> MpcParty<M, MockedDelivery<M>>
Adds new party to the network
sourcepub fn connect_new_party(&mut self) -> MockedDelivery<M>
pub fn connect_new_party(&mut self) -> MockedDelivery<M>
Connects new party to the network
Similar to .add_party() but returns MockedDelivery<M> instead of
MpcParty<M, MockedDelivery<M>>
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for Simulation<M>
impl<M> !RefUnwindSafe for Simulation<M>
impl<M> Send for Simulation<M>where
M: Send,
impl<M> Sync for Simulation<M>where
M: Send,
impl<M> Unpin for Simulation<M>
impl<M> !UnwindSafe for Simulation<M>
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