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

pub struct Crds {
    pub table: IndexMap<CrdsValueLabel, VersionedCrdsValue>,
}

Fields

table: IndexMap<CrdsValueLabel, VersionedCrdsValue>

Stores the map of labels and values

Methods

impl Crds[src]

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

must be called atomically with insert_versioned

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 update_record_timestamp(&mut self, pubkey: &Pubkey, now: u64)[src]

Update the timestamp's of all the labels that are assosciated with Pubkey

pub fn find_old_labels(
    &self,
    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)[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> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> Erased for T

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

impl<T> InitializableFromZeroed for T where
    T: Default

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