[][src]Struct gossip::PeerSamplingConfig

pub struct PeerSamplingConfig { /* fields omitted */ }

The peer sampling parameters

See: Gossip-based Peer Sampling

Implementations

impl PeerSamplingConfig[src]

pub fn new(
    push: bool,
    pull: bool,
    sampling_period: u64,
    view_size: usize,
    healing_factor: usize,
    swapping_factor: usize
) -> Self
[src]

Create a new peer sampling configuration

Arguments

  • push - Does the node push its view to other peers
  • pull - When active, if the node will pull views from other peers; when passive, if it responds with its view to push requests
  • sampling_period - The interval between each cycle of push/pull
  • view_size - The number of peers in the view of the node
  • healing_factor - The number of removal at each cycle
  • swapping_factor - The number of peer swapped at each cycle

pub fn new_with_deviation(
    push: bool,
    pull: bool,
    sampling_period: u64,
    sampling_deviation: u64,
    view_size: usize,
    healing_factor: usize,
    swapping_factor: usize
) -> 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

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

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

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

pub fn healing_factor(&self) -> usize[src]

pub fn swapping_factor(&self) -> usize[src]

pub fn view_size(&self) -> usize[src]

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

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

Trait Implementations

impl Clone for PeerSamplingConfig[src]

impl Default for PeerSamplingConfig[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,