[−][src]Struct sdset::Counter
A Collection
that only counts the final size of a set operation.
It is meant to be used to avoid unecessary allocations.
use sdset::duo::OpBuilder; use sdset::{SetOperation, Set, SetBuf, Counter}; let a = Set::new(&[1, 2, 4, 6, 7])?; let b = Set::new(&[2, 3, 4, 5, 6, 7])?; let op = OpBuilder::new(a, b).union(); let mut counter = Counter::default(); SetOperation::<i32>::extend_collection(op, &mut counter); assert_eq!(counter.0, 7);
Methods
impl Counter
[src]
Trait Implementations
impl<T> Collection<T> for Counter
[src]
fn push(&mut self, _elem: T)
[src]
fn extend_from_slice(&mut self, elems: &[T]) where
T: Clone,
[src]
T: Clone,
fn extend<I>(&mut self, elems: I) where
I: IntoIterator<Item = T>,
[src]
I: IntoIterator<Item = T>,
fn reserve(&mut self, _size: usize)
[src]
impl Default for Counter
[src]
Auto Trait Implementations
impl RefUnwindSafe for Counter
impl Send for Counter
impl Sync for Counter
impl Unpin for Counter
impl UnwindSafe for Counter
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,
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, 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.
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>,