[−][src]Struct gossip::PeerSamplingConfig
The peer sampling parameters
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]
push: bool,
pull: bool,
sampling_period: u64,
view_size: usize,
healing_factor: usize,
swapping_factor: usize
) -> Self
Create a new peer sampling configuration
Arguments
push
- Does the node push its view to other peerspull
- When active, if the node will pull views from other peers; when passive, if it responds with its view to push requestssampling_period
- The interval between each cycle of push/pullview_size
- The number of peers in the view of the nodehealing_factor
- The number of removal at each cycleswapping_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]
push: bool,
pull: bool,
sampling_period: u64,
sampling_deviation: u64,
view_size: usize,
healing_factor: usize,
swapping_factor: usize
) -> Self
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]
pub fn clone(&self) -> PeerSamplingConfig
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for PeerSamplingConfig
[src]
Auto Trait Implementations
impl RefUnwindSafe for PeerSamplingConfig
[src]
impl Send for PeerSamplingConfig
[src]
impl Sync for PeerSamplingConfig
[src]
impl Unpin for PeerSamplingConfig
[src]
impl UnwindSafe for PeerSamplingConfig
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,