pub struct SlotMetadata(/* private fields */);Expand description
A compact metadata tag for one filter slot.
Wraps a single u8 with three bit flags:
- Occupied (bit 0)
- Continuation (bit 1)
- Shifted (bit 2)
Implementations§
Source§impl SlotMetadata
impl SlotMetadata
Sourcepub const fn with_flags(
is_occupied: bool,
is_continuation: bool,
is_shifted: bool,
) -> Self
pub const fn with_flags( is_occupied: bool, is_continuation: bool, is_shifted: bool, ) -> Self
Sourcepub const fn is_occupied(&self) -> bool
pub const fn is_occupied(&self) -> bool
Reads the “occupied” flag.
Indicates whether this canonical slot is the start of a run.
§Returns
true if occupied
Sourcepub fn set_occupied(&mut self, value: bool)
pub fn set_occupied(&mut self, value: bool)
Sourcepub const fn is_continuation(&self) -> bool
pub const fn is_continuation(&self) -> bool
Reads the “continuation” flag.
Indicates whether this slot is part of a run that started in a previous slot.
§Returns
true if this is a continuation slot
Sourcepub const fn set_continuation(&mut self, value: bool)
pub const fn set_continuation(&mut self, value: bool)
Sourcepub const fn is_shifted(&self) -> bool
pub const fn is_shifted(&self) -> bool
Reads the “shifted” flag.
Indicates whether this slot’s data was displaced from its canonical position due to collisions during insertion.
§Returns
true if this slot is shifted
Sourcepub const fn set_shifted(&mut self, value: bool)
pub const fn set_shifted(&mut self, value: bool)
Sourcepub const fn is_cluster_start(&self) -> bool
pub const fn is_cluster_start(&self) -> bool
Checks if this slot is a cluster start.
A cluster start is occupied and not shifted (canonical position).
§Returns
true if this slot starts a cluster
Sourcepub const fn is_run_start(&self) -> bool
pub const fn is_run_start(&self) -> bool
Checks if this slot is a run start within a cluster.
A run start is not a continuation and has some presence signal (either occupied or shifted).
§Returns
true if this slot starts a run
Sourcepub const fn has_data(&self) -> bool
pub const fn has_data(&self) -> bool
Checks if this slot has meaningful metadata.
A slot has data if any of the three flags are set.
§Returns
true if any flag is set
Trait Implementations§
Source§impl Clone for SlotMetadata
impl Clone for SlotMetadata
Source§fn clone(&self) -> SlotMetadata
fn clone(&self) -> SlotMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more