Skip to main content

ResidencyWindowManager

Trait ResidencyWindowManager 

Source
pub trait ResidencyWindowManager {
    type Error: Error + From<ResidencyWindowError>;

    // Required methods
    fn prepare_window(
        &self,
        active: &[OffloadUnitId],
        upcoming: &[OffloadUnitId],
        tier: MemoryTier,
    ) -> Result<Vec<(OffloadUnitId, PrefetchOutcome)>, Self::Error>;
    fn prepare_group_window(
        &self,
        group: &str,
        active: &[OffloadUnitId],
        upcoming: &[OffloadUnitId],
        tier: MemoryTier,
    ) -> Result<Vec<(OffloadUnitId, PrefetchOutcome)>, Self::Error>;
    fn evict(
        &self,
        id: &OffloadUnitId,
        tier: MemoryTier,
    ) -> Result<bool, Self::Error>;
    fn unit_reports(&self) -> Result<Vec<UnitResidencyReport>, Self::Error>;
}
Expand description

Backend-independent operations required by ordered residency windows.

Required Associated Types§

Source

type Error: Error + From<ResidencyWindowError>

Manager-specific failure including neutral window validation failures.

Required Methods§

Source

fn prepare_window( &self, active: &[OffloadUnitId], upcoming: &[OffloadUnitId], tier: MemoryTier, ) -> Result<Vec<(OffloadUnitId, PrefetchOutcome)>, Self::Error>

Replaces the default protected window and prepares bounded lookahead.

Source

fn prepare_group_window( &self, group: &str, active: &[OffloadUnitId], upcoming: &[OffloadUnitId], tier: MemoryTier, ) -> Result<Vec<(OffloadUnitId, PrefetchOutcome)>, Self::Error>

Replaces one named protected window and prepares bounded lookahead.

Source

fn evict( &self, id: &OffloadUnitId, tier: MemoryTier, ) -> Result<bool, Self::Error>

Removes one concrete resident copy if present.

Source

fn unit_reports(&self) -> Result<Vec<UnitResidencyReport>, Self::Error>

Returns logical unit state in stable identifier order.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§