[][src]Struct gossip::GossipConfig

pub struct GossipConfig { /* fields omitted */ }

The gossip parameters

Implementations

impl GossipConfig[src]

pub fn new(
    push: bool,
    pull: bool,
    gossip_period: u64,
    update_expiration: UpdateExpirationMode
) -> Self
[src]

Creates a new gossip configuration

Arguments

  • push - If the node push its content to other nodes
  • pull - When active, if the node will pull content from other peers; when passive, if the node responds with its content to push requests
  • gossip_period - Length of each gossip period
  • update_expiration - Strategy for update expiration, see UpdateExpirationMode

pub fn new_with_deviation(
    push: bool,
    pull: bool,
    gossip_period: u64,
    gossip_deviation: u64,
    update_expiration: UpdateExpirationMode
) -> Self
[src]

Creates a new configuration with the possibility to randomize the period; this is useful when testing locally in order to avoid network saturation

Arguments

  • gossip_deviation - The maximum value of the random value added to the period

pub fn is_push(&self) -> bool[src]

pub fn is_pull(&self) -> bool[src]

pub fn gossip_period(&self) -> u64[src]

pub fn gossip_deviation(&self) -> u64[src]

pub fn update_expiration(&self) -> &UpdateExpirationMode[src]

Trait Implementations

impl Default for GossipConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,