Skip to main content

SlotMetadata

Struct SlotMetadata 

Source
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

Source

pub const fn new() -> Self

Creates empty metadata (all bits off).

§Returns

Metadata with all flags cleared

Source

pub const fn with_flags( is_occupied: bool, is_continuation: bool, is_shifted: bool, ) -> Self

Creates metadata with specific flag values.

§Arguments
  • is_occupied - Whether this canonical slot starts a run
  • is_continuation - Whether this slot continues a run
  • is_shifted - Whether this slot’s data is displaced from canonical position
§Returns

Metadata with the specified flags set

Source

pub const fn is_empty(&self) -> bool

Checks if this metadata is completely empty (all flags off).

§Returns

true if no flags are set

Source

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

Source

pub fn set_occupied(&mut self, value: bool)

Sets the “occupied” flag.

§Arguments
  • value - true to set occupied, false to clear
Source

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

Source

pub const fn set_continuation(&mut self, value: bool)

Sets the “continuation” flag.

§Arguments
  • value - true to mark as continuation, false otherwise
Source

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

Source

pub const fn set_shifted(&mut self, value: bool)

Sets the “shifted” flag.

§Arguments
  • value - true to mark as shifted, false otherwise
Source

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

Source

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

Source

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

Source

pub fn clear(&mut self)

Clears all metadata flags (resets to empty).

§Complexity

O(1)

Source

pub const fn raw(&self) -> u8

Returns the raw byte value for serialization/storage.

§Returns

The 8-bit flags value

Source

pub const fn from_raw(value: u8) -> Self

Constructs metadata from a raw byte (for deserialization).

§Arguments
  • value - Raw byte containing bit flags
§Returns

Reconstructed metadata

Trait Implementations§

Source§

impl Clone for SlotMetadata

Source§

fn clone(&self) -> SlotMetadata

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SlotMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Produces verbose debug output showing all three flags by name.

Example: SlotMetadata { occupied: true, continuation: false, shifted: true }

Source§

impl Default for SlotMetadata

Source§

fn default() -> SlotMetadata

Returns the “default value” for a type. Read more
Source§

impl Display for SlotMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Produces compact 3-character display of metadata flags.

Format: [O|-][C|-][S|-]

  • O = occupied, - = not occupied
  • C = continuation, - = not continuation
  • S = shifted, - = not shifted

Examples: OCS, O--, -C-, ---

Source§

impl PartialEq for SlotMetadata

Source§

fn eq(&self, other: &SlotMetadata) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SlotMetadata

Source§

impl Eq for SlotMetadata

Source§

impl StructuralPartialEq for SlotMetadata

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.