pub trait Intersection<Rhs, N, B>{
// Required methods
fn intersection_in<Dst>(&self, rhs: &Rhs, dst: &mut Dst)
where Dst: ContainerWrite<B, Slot = N>;
fn try_intersection_in<Dst>(
&self,
rhs: &Rhs,
dst: &mut Dst,
) -> Result<(), IntersectionError>
where Dst: ContainerWrite<B, Slot = N>;
fn intersection<Dst>(&self, rhs: &Rhs) -> Dst
where Dst: ContainerWrite<B, Slot = N> + TryWithSlots;
fn try_intersection<Dst>(&self, rhs: &Rhs) -> Result<Dst, IntersectionError>
where Dst: ContainerWrite<B, Slot = N> + TryWithSlots;
fn intersection_len(&self, rhs: &Rhs) -> usize;
}
Expand description
Intersection operator (a & b).
Required Methods§
Sourcefn intersection_in<Dst>(&self, rhs: &Rhs, dst: &mut Dst)where
Dst: ContainerWrite<B, Slot = N>,
fn intersection_in<Dst>(&self, rhs: &Rhs, dst: &mut Dst)where
Dst: ContainerWrite<B, Slot = N>,
Calculates intersection in-place. Result will be stored in dst
.
§Panic
Panics if dst
cannot fit the entire result.
See non-panic function try_intersection_in
.
Sourcefn try_intersection_in<Dst>(
&self,
rhs: &Rhs,
dst: &mut Dst,
) -> Result<(), IntersectionError>where
Dst: ContainerWrite<B, Slot = N>,
fn try_intersection_in<Dst>(
&self,
rhs: &Rhs,
dst: &mut Dst,
) -> Result<(), IntersectionError>where
Dst: ContainerWrite<B, Slot = N>,
Calculates intersection in-place. Result will be stored in dst
.
Returns Err(_)
if dst
cannot fit the entire result.
Sourcefn intersection<Dst>(&self, rhs: &Rhs) -> Dstwhere
Dst: ContainerWrite<B, Slot = N> + TryWithSlots,
fn intersection<Dst>(&self, rhs: &Rhs) -> Dstwhere
Dst: ContainerWrite<B, Slot = N> + TryWithSlots,
Calculates intersection. Result container will be created with try_with_slots
function.
§Panic
Panics if Dst
cannot fit the entire result.
See non-panic function try_intersection
.
Sourcefn try_intersection<Dst>(&self, rhs: &Rhs) -> Result<Dst, IntersectionError>where
Dst: ContainerWrite<B, Slot = N> + TryWithSlots,
fn try_intersection<Dst>(&self, rhs: &Rhs) -> Result<Dst, IntersectionError>where
Dst: ContainerWrite<B, Slot = N> + TryWithSlots,
Calculates intersection. Result container will be created with try_with_slots
function.
Returns Err(_)
if Dst
cannot fit the entire result.
Sourcefn intersection_len(&self, rhs: &Rhs) -> usize
fn intersection_len(&self, rhs: &Rhs) -> usize
Calculates intersection length - ones count. It doesn’t allocate for storing intersection result.
Useful if you need to create some storage that relies on the number of required bits presented in the bitmap.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.