pub struct SimulatorConfig {
pub rng_seed: u64,
pub peers: usize,
pub gossip_round_timeout: Duration,
}
Available on crate feature
test-utils
only.Expand description
Configuration for the Simulator
.
Fields§
§rng_seed: u64
Seed for the random number generator used in the nodes
peers: usize
Number of nodes to create
gossip_round_timeout: Duration
Timeout after which a gossip round is aborted
Implementations§
Source§impl SimulatorConfig
impl SimulatorConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Creates a SimulatorConfig
by reading from environment variables.
Self::peers
is read from PEERS
, defaulting to 100
if unset.
Self::rng_seed
is read from SEED
, defaulting to 0
if unset.
Self::gossip_round_timeout
is read, as seconds, from GOSSIP_ROUND_TIMEOUT
, defaulting to 5
if unset.
Trait Implementations§
Source§impl Debug for SimulatorConfig
impl Debug for SimulatorConfig
Source§impl Default for SimulatorConfig
impl Default for SimulatorConfig
Source§impl<'de> Deserialize<'de> for SimulatorConfig
impl<'de> Deserialize<'de> for SimulatorConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SimulatorConfig
impl RefUnwindSafe for SimulatorConfig
impl Send for SimulatorConfig
impl Sync for SimulatorConfig
impl Unpin for SimulatorConfig
impl UnwindSafe for SimulatorConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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