Trait BitSetOp

Source
pub trait BitSetOp:
    Default
    + Copy
    + 'static {
    const TRUSTED_HIERARCHY: bool;
    const HIERARCHY_OPERANDS_CONTAIN_RESULT: bool;

    // Required methods
    fn hierarchy_op<T: BitBlock>(left: T, right: T) -> T;
    fn data_op<T: BitBlock>(left: T, right: T) -> T;
}
Expand description

Binary operation interface for BitSetInterfaces.

Implement this trait for creating your own operation. Pay attention to hierarchical nature of hi_sparse_bitset - you may need to apply “broader” operations to “hierarchical blocks”, then to “data blocks”.

Required Associated Constants§

Source

const TRUSTED_HIERARCHY: bool

Will operation between two TRUSTED_HIERARCHY bitsets produce TRUSTED_HIERARCHY as well?

Enables some optimizations. False - is always safe value.

Source

const HIERARCHY_OPERANDS_CONTAIN_RESULT: bool

Does hierarchy_op operands contain result?

This is true for intersection, or narrower.

Enables some optimizations. False - is always a safe value.

Required Methods§

Source

fn hierarchy_op<T: BitBlock>(left: T, right: T) -> T

Operation applied to indirection/hierarchy level bitblock

Source

fn data_op<T: BitBlock>(left: T, right: T) -> T

Operation applied to data level bitblock

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.

Implementors§