pub struct SetUsize(_);
Expand description
Implementations
sourceimpl SetUsize
impl SetUsize
sourcepub fn with_capacity_of(other: &Self) -> Self
pub fn with_capacity_of(other: &Self) -> Self
Create an empty set with capacity to hold the provided set.
use tinyset::SetUsize;
let a: SetUsize = (1..300).collect();
let mut b = SetUsize::with_capacity_of(&a);
assert_eq!(a.capacity(), b.capacity());
assert_eq!(b.len(), 0);
for i in a.iter() {
b.insert(i);
}
assert_eq!(a.capacity(), b.capacity());
assert_eq!(b.len(), a.len());
Create an empty set with capacity to hold the provided set.
sourceimpl SetUsize
impl SetUsize
sourcepub fn insert(&mut self, elem: usize) -> bool
pub fn insert(&mut self, elem: usize) -> bool
Adds a value to the set.
If the set did not have this value present, true
is returned.
If the set did have this value present, false
is returned.
Trait Implementations
sourceimpl<'a, 'b> BitOr<&'b SetUsize> for &'a SetUsize
impl<'a, 'b> BitOr<&'b SetUsize> for &'a SetUsize
sourceimpl<'b> BitOr<&'b SetUsize> for SetUsize
impl<'b> BitOr<&'b SetUsize> for SetUsize
sourceimpl Extend<usize> for SetUsize
impl Extend<usize> for SetUsize
sourcefn extend<T: IntoIterator<Item = usize>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = usize>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl FromIterator<usize> for SetUsize
impl FromIterator<usize> for SetUsize
sourcefn from_iter<I: IntoIterator<Item = usize>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = usize>>(iter: I) -> Self
Creates a value from an iterator. Read more
sourceimpl IntoIterator for SetUsize
impl IntoIterator for SetUsize
sourceimpl<'a, 'b> Sub<&'b SetUsize> for &'a SetUsize
impl<'a, 'b> Sub<&'b SetUsize> for &'a SetUsize
sourceimpl<'b> Sub<&'b SetUsize> for SetUsize
impl<'b> Sub<&'b SetUsize> for SetUsize
impl Eq for SetUsize
Auto Trait Implementations
impl RefUnwindSafe for SetUsize
impl Send for SetUsize
impl Sync for SetUsize
impl Unpin for SetUsize
impl UnwindSafe for SetUsize
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