Skip to main content

SweepContext

Struct SweepContext 

Source
pub struct SweepContext {
    pub history: Vec<Vec<u64>>,
    pub window_size: usize,
    pub direction: &'static str,
    pub prefetch_count: usize,
    pub predicted_next: Vec<Vec<u64>>,
}
Expand description

Sweep context passed into read_chunked_data_sweep to enable adaptive prefetching based on detected access patterns.

The caller is responsible for maintaining the SweepContext across multiple reads on the same dataset. After each read, the context will contain updated sweep detection state and any predicted next-chunk coordinates.

Fields§

§history: Vec<Vec<u64>>

Sliding window of recent chunk coordinates.

§window_size: usize

Maximum window size.

§direction: &'static str

Currently detected sweep direction label.

§prefetch_count: usize

How many chunks ahead to predict.

§predicted_next: Vec<Vec<u64>>

Predicted next chunk coordinates (populated after each read).

Implementations§

Source§

impl SweepContext

Source

pub fn new(window_size: usize, prefetch_count: usize) -> Self

Create a new sweep context with the given window size and prefetch count.

Source

pub fn with_defaults() -> Self

Create with default settings (window=12, prefetch=4).

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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.