Skip to main content

BackingReader

Struct BackingReader 

Source
pub struct BackingReader<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> BackingReader<'a>

Source

pub fn new( file: &'a File, buf: &'a Arc<Mutex<ReadAhead>>, pool: &'a ReadAheadPool, key: usize, backing_len: u64, epoch: &'a AtomicU64, ) -> Self

Source

pub fn with_prefetch_planning(self) -> Self

Opt into prefetch-plan capture: every backing read sizes the eviction ring and records the post-read next_expected/window under the read lock, so the caller reads them via Self::prefetch_plan without a second lock acquisition (#429).

Source

pub fn prefetch_plan(&self) -> (u64, u64)

The (next_expected, window) captured by the most recent backing read, or (u64::MAX, 0) if no backing read occurred. Only meaningful when constructed via Self::with_prefetch_planning.

Source

pub fn fills(&self) -> u64

Source

pub fn file(&self) -> &File

Source

pub fn read_exact_at(&self, dst: &mut [u8], abs_offset: u64) -> Result<()>

Auto Trait Implementations§

§

impl<'a> !Freeze for BackingReader<'a>

§

impl<'a> !RefUnwindSafe for BackingReader<'a>

§

impl<'a> !Sync for BackingReader<'a>

§

impl<'a> Send for BackingReader<'a>

§

impl<'a> Unpin for BackingReader<'a>

§

impl<'a> UnsafeUnpin for BackingReader<'a>

§

impl<'a> UnwindSafe for BackingReader<'a>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = 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.