pub struct ResidencyMachine { /* private fields */ }Expand description
Fixed-capacity state machine with stable slot-order decisions.
Implementations§
Source§impl ResidencyMachine
impl ResidencyMachine
Sourcepub fn request(
&mut self,
chunk: ChunkId,
footprint: ChunkFootprint,
) -> Result<ResidencyTicket, ResidencyMachineError>
pub fn request( &mut self, chunk: ChunkId, footprint: ChunkFootprint, ) -> Result<ResidencyTicket, ResidencyMachineError>
Associates the lowest vacant slot with one chunk.
§Errors
Returns ResidencyMachineError::Capacity when no slot is vacant.
Sourcepub fn ready_cpu(
&mut self,
ticket: ResidencyTicket,
) -> Result<(), ResidencyMachineError>
pub fn ready_cpu( &mut self, ticket: ResidencyTicket, ) -> Result<(), ResidencyMachineError>
Sourcepub fn uploading(
&mut self,
ticket: ResidencyTicket,
) -> Result<(), ResidencyMachineError>
pub fn uploading( &mut self, ticket: ResidencyTicket, ) -> Result<(), ResidencyMachineError>
Marks staging as consumed by an upload command.
§Errors
The ticket must currently be ready on the CPU.
Sourcepub fn resident(
&mut self,
ticket: ResidencyTicket,
) -> Result<(), ResidencyMachineError>
pub fn resident( &mut self, ticket: ResidencyTicket, ) -> Result<(), ResidencyMachineError>
Sourcepub fn state(&self, ticket: ResidencyTicket) -> Option<ResidencyState>
pub fn state(&self, ticket: ResidencyTicket) -> Option<ResidencyState>
Current state of a live ticket.
Sourcepub const fn metrics(&self) -> ResidencyMachineMetrics
pub const fn metrics(&self) -> ResidencyMachineMetrics
Current gauges and cumulative counters.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResidencyMachine
impl RefUnwindSafe for ResidencyMachine
impl Send for ResidencyMachine
impl Sync for ResidencyMachine
impl Unpin for ResidencyMachine
impl UnsafeUnpin for ResidencyMachine
impl UnwindSafe for ResidencyMachine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more