Struct tinyset::setu64::SetU64 [−][src]
pub struct SetU64(_);
Expand description
A set of u64
Implementations
Create an empty set with capacity to hold the provided set.
let a: tinyset::SetU64 = (1..300).collect();
let mut b = tinyset::SetU64::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 a set with the given capacity
Create a set with the given capacity and bits
Trait Implementations
Returns the union of self
and rhs
as a new SetU64
, consuming self
.
Examples
let a: tinyset::SetU64 = (1..4).collect();
let b: tinyset::SetU64 = (3..6).collect();
assert_eq!(a | &b, (1..6).collect());
Creates a value from an iterator. Read more
Returns the difference of self
and rhs
as a new SetU64
.
Examples
let a: tinyset::SetU64 = (1..4).collect();
let b: tinyset::SetU64 = (3..6).into_iter().collect();
assert_eq!(&a - &b, (1..3).collect());
Returns the difference of self
and rhs
as a new SetU64
consuming self
. Should not allocate.
Examples
let a: tinyset::SetU64 = (1..4).collect();
let b: tinyset::SetU64 = (3..6).into_iter().collect();
assert_eq!(a - &b, (1..3).collect());
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more