Skip to main content

CacheIoExecutionState

Struct CacheIoExecutionState 

Source
pub struct CacheIoExecutionState { /* private fields */ }
Expand description

Canonical admission and cancellation state for a bounded cache I/O worker.

Backends own task payloads, worker threads, files, buffers, and completion objects. This state owns exact-key coalescing, bounded admission, queued and in-flight cancellation, and peak queue accounting.

Implementations§

Source§

impl CacheIoExecutionState

Source

pub fn new(capacity: usize) -> Result<Self, CacheIoExecutionStateError>

Creates an empty state with finite nonzero queue capacity.

Source

pub fn prepare(&mut self, key: CacheIoOperationKey) -> CacheIoPreparation

Registers an exact key or joins its existing completion owner.

Source

pub fn admit( &mut self, key: &CacheIoOperationKey, ) -> Result<CacheIoAdmission, CacheIoExecutionStateError>

Attempts to admit one previously prepared operation.

Source

pub fn rollback_admission( &mut self, key: &CacheIoOperationKey, ) -> Result<(), CacheIoExecutionStateError>

Rolls back physical enqueue failure without losing exact-key ownership.

Source

pub fn begin( &mut self, key: &CacheIoOperationKey, ) -> Result<CacheIoStartDisposition, CacheIoExecutionStateError>

Begins one operation received by the physical executor.

Source

pub fn cancel(&mut self, key: &CacheIoOperationKey) -> bool

Cancels prepared, queued, or physically executing work exactly once.

Source

pub fn complete( &mut self, key: &CacheIoOperationKey, ) -> Result<CacheIoCompletionDisposition, CacheIoExecutionStateError>

Resolves one exact physically executed operation.

Source

pub fn retire( &mut self, key: &CacheIoOperationKey, ) -> Result<bool, CacheIoExecutionStateError>

Releases exact-key ownership after task resources are safe to drop.

Source

pub const fn queued(&self) -> usize

Current physically queued operation count.

Source

pub const fn peak_queued(&self) -> usize

Largest physically queued operation count.

Trait Implementations§

Source§

impl Debug for CacheIoExecutionState

Source§

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

Formats the value using the given formatter. Read more

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

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.