pub struct EpidemicConfig {
pub forward_probability: f64,
pub max_forwards: u32,
}Expand description
Configuration for epidemic broadcast.
Fields§
§forward_probability: f64Probability of forwarding a message (0.0 - 1.0)
max_forwards: u32Maximum number of times to forward
Implementations§
Source§impl EpidemicConfig
impl EpidemicConfig
Sourcepub fn should_forward(&self) -> bool
pub fn should_forward(&self) -> bool
Determine if message should be forwarded.
Trait Implementations§
Source§impl Clone for EpidemicConfig
impl Clone for EpidemicConfig
Source§fn clone(&self) -> EpidemicConfig
fn clone(&self) -> EpidemicConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 EpidemicConfig
impl Debug for EpidemicConfig
Source§impl Default for EpidemicConfig
impl Default for EpidemicConfig
Source§impl<'de> Deserialize<'de> for EpidemicConfig
impl<'de> Deserialize<'de> for EpidemicConfig
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 EpidemicConfig
impl RefUnwindSafe for EpidemicConfig
impl Send for EpidemicConfig
impl Sync for EpidemicConfig
impl Unpin for EpidemicConfig
impl UnwindSafe for EpidemicConfig
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