Struct raft::util::Union [−][src]
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]
first: &'a HashSet<u64, BuildHasherDefault<FxHasher>>,
second: &'a HashSet<u64, BuildHasherDefault<FxHasher>>
) -> Union<'a>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized, [src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>, [src]
V: MultiLane<T>,