[][src]Struct solana::crds_gossip::CrdsGossip

pub struct CrdsGossip {
    pub crds: Crds,
    pub id: Pubkey,
    pub push: CrdsGossipPush,
    pub pull: CrdsGossipPull,
}

Fields

crds: Crdsid: Pubkeypush: CrdsGossipPushpull: CrdsGossipPull

Methods

impl CrdsGossip[src]

pub fn set_self(&mut self, id: &Pubkey)[src]

pub fn process_push_message(
    &mut self,
    values: Vec<CrdsValue>,
    now: u64
) -> Vec<Pubkey>
[src]

process a push message to the network

pub fn new_push_messages(
    &mut self,
    now: u64
) -> (Pubkey, HashMap<Pubkey, Vec<CrdsValue>>)
[src]

pub fn process_prune_msg(
    &mut self,
    peer: &Pubkey,
    destination: &Pubkey,
    origin: &[Pubkey],
    wallclock: u64,
    now: u64
) -> Result<(), CrdsGossipError>
[src]

add the from to the peer's filter of nodes

pub fn refresh_push_active_set(&mut self, stakes: &HashMap<Pubkey, u64>)[src]

refresh the push active set

  • ratio - number of actives to rotate

pub fn new_pull_request(
    &self,
    now: u64,
    stakes: &HashMap<Pubkey, u64>
) -> Result<(Pubkey, Bloom<Hash>, CrdsValue), CrdsGossipError>
[src]

generate a random request

pub fn mark_pull_request_creation_time(&mut self, from: &Pubkey, now: u64)[src]

time when a request to from was initiated This is used for weighted random selection during new_pull_request It's important to use the local nodes request creation time as the weight instead of the response received time otherwise failed nodes will increase their weight.

pub fn process_pull_request(
    &mut self,
    caller: CrdsValue,
    filter: Bloom<Hash>,
    now: u64
) -> Vec<CrdsValue>
[src]

process a pull request and create a response

pub fn process_pull_response(
    &mut self,
    from: &Pubkey,
    response: Vec<CrdsValue>,
    now: u64
) -> usize
[src]

process a pull response

pub fn purge(&mut self, now: u64)[src]

Trait Implementations

impl Default for CrdsGossip[src]

impl Clone for CrdsGossip[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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