Struct raft::util::Union[][src]

pub struct Union<'a> { /* fields omitted */ }

A convenient struct that handles queries to both HashSet.

Implementations

impl<'a> Union<'a>[src]

pub fn new(
    first: &'a HashSet<u64, BuildHasherDefault<FxHasher>>,
    second: &'a HashSet<u64, BuildHasherDefault<FxHasher>>
) -> Union<'a>
[src]

Creates a union.

pub fn contains(&self, id: u64) -> bool[src]

Checks if id shows up in either HashSet.

pub fn iter(&self) -> impl Iterator<Item = u64> + '_[src]

Returns an iterator iterates the distinct values in two sets.

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

Checks if union is empty.

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

Gets the count of the union.

The time complexity is O(n).

Auto Trait Implementations

impl<'a> RefUnwindSafe for Union<'a>

impl<'a> Send for Union<'a>

impl<'a> Sync for Union<'a>

impl<'a> Unpin for Union<'a>

impl<'a> UnwindSafe for Union<'a>

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[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<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]