Struct solana_gossip::crds_shards::CrdsShards
source · pub struct CrdsShards {
shards: Vec<IndexMap<usize, u64>>,
shard_bits: u32,
}
Fields§
§shards: Vec<IndexMap<usize, u64>>
§shard_bits: u32
Implementations§
source§impl CrdsShards
impl CrdsShards
pub fn new(shard_bits: u32) -> Self
pub fn insert(&mut self, index: usize, value: &VersionedCrdsValue) -> bool
pub fn remove(&mut self, index: usize, value: &VersionedCrdsValue) -> bool
sourcepub fn find(
&self,
mask: u64,
mask_bits: u32
) -> impl Iterator<Item = usize> + '_
pub fn find( &self, mask: u64, mask_bits: u32 ) -> impl Iterator<Item = usize> + '_
Returns indices of all crds values which the first ‘mask_bits’ of their hash value is equal to ‘mask’.
fn shard_index(&self, hash: u64) -> usize
fn shard(&self, hash: u64) -> &IndexMap<usize, u64>
fn shard_mut(&mut self, hash: u64) -> &mut IndexMap<usize, u64>
Trait Implementations§
source§impl Clone for CrdsShards
impl Clone for CrdsShards
source§fn clone(&self) -> CrdsShards
fn clone(&self) -> CrdsShards
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for CrdsShards
impl Send for CrdsShards
impl Sync for CrdsShards
impl Unpin for CrdsShards
impl UnwindSafe for CrdsShards
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request