pub struct Bag { /* private fields */ }
Expand description
Represents a bag of multiple Ids for binary voting. ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/ids#Bag
Implementations
sourceimpl Bag
impl Bag
pub fn new() -> Self
pub fn deep_copy(&self) -> Self
pub fn is_empty(&self) -> bool
pub fn len(&self) -> u32
pub fn mode(&self) -> Id
pub fn mode_frequency(&self) -> u32
pub fn threshold(&self) -> u32
sourcepub fn met_threshold(&self) -> HashSet<Id>
pub fn met_threshold(&self) -> HashSet<Id>
Returns the Ids that have been seen at least threshold times.
pub fn list(&self) -> Vec<Id>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
pub fn counts(&self) -> HashMap<Id, u32>
pub fn set_threshold(&self, threshold: u32)
pub fn add_count(&self, id: &Id, count: u32)
pub fn count(&self, id: &Id) -> u32
pub fn equals(&self, other: &Self) -> bool
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Bag
impl !Send for Bag
impl !Sync for Bag
impl Unpin for Bag
impl !UnwindSafe for Bag
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request