Struct solana_core::crds::Crds[][src]

pub struct Crds {
    pub num_inserts: usize,
    // some fields omitted
}

Fields

num_inserts: usize

Implementations

impl Crds[src]

pub fn new_versioned(
    &self,
    local_timestamp: u64,
    value: CrdsValue
) -> VersionedCrdsValue
[src]

must be called atomically with insert_versioned

pub fn would_insert(
    &self,
    value: CrdsValue,
    local_timestamp: u64
) -> (bool, VersionedCrdsValue)
[src]

pub fn insert_versioned(
    &mut self,
    new_value: VersionedCrdsValue
) -> Result<Option<VersionedCrdsValue>, CrdsError>
[src]

insert the new value, returns the old value if insert succeeds

pub fn insert(
    &mut self,
    value: CrdsValue,
    local_timestamp: u64
) -> Result<Option<VersionedCrdsValue>, CrdsError>
[src]

pub fn lookup(&self, label: &CrdsValueLabel) -> Option<&CrdsValue>[src]

pub fn lookup_versioned(
    &self,
    label: &CrdsValueLabel
) -> Option<&VersionedCrdsValue>
[src]

pub fn get(&self, label: &CrdsValueLabel) -> Option<&VersionedCrdsValue>[src]

pub fn get_contact_info(&self, pubkey: Pubkey) -> Option<&ContactInfo>[src]

pub fn get_lowest_slot(&self, pubkey: Pubkey) -> Option<&LowestSlot>[src]

pub fn get_nodes(&self) -> impl Iterator<Item = &VersionedCrdsValue>[src]

Returns all entries which are ContactInfo.

pub fn get_nodes_contact_info(&self) -> impl Iterator<Item = &ContactInfo>[src]

Returns ContactInfo of all known nodes.

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

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

pub fn values(&self) -> Values<'_, CrdsValueLabel, VersionedCrdsValue>[src]

pub fn par_values(&self) -> ParValues<'_, CrdsValueLabel, VersionedCrdsValue>[src]

pub fn filter_bitmask(
    &self,
    mask: u64,
    mask_bits: u32
) -> impl Iterator<Item = &VersionedCrdsValue>
[src]

Returns all crds values which the first ‘mask_bits’ of their hash value is equal to ‘mask’.

pub fn update_record_timestamp(&mut self, pubkey: &Pubkey, now: u64)[src]

Update the timestamp’s of all the labels that are associated with Pubkey

pub fn find_old_labels(
    &self,
    thread_pool: &ThreadPool,
    now: u64,
    timeouts: &HashMap<Pubkey, u64>
) -> Vec<CrdsValueLabel>
[src]

Find all the keys that are older or equal to the timeout.

  • timeouts - Pubkey specific timeouts with Pubkey::default() as the default timeout.

pub fn remove(&mut self, key: &CrdsValueLabel) -> Option<VersionedCrdsValue>[src]

Trait Implementations

impl Clone for Crds[src]

impl Default for Crds[src]

Auto Trait Implementations

impl RefUnwindSafe for Crds

impl Send for Crds

impl Sync for Crds

impl Unpin for Crds

impl UnwindSafe for Crds

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> Instrument for T[src]

impl<T> Instrument for T[src]

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

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

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

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

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<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> WithSubscriber for T[src]