Skip to main content

SwapProvider

Trait SwapProvider 

Source
pub trait SwapProvider {
    // Required methods
    fn swap_out(&self, page: &PageObject) -> Result<SwapToken, SwapError>;
    fn swap_in(
        &self,
        token: SwapToken,
        frame: FrameLease,
    ) -> Result<(), SwapError>;
}
Expand description

Capability boundary for anonymous swap.

Keeping this interface typed lets MADV_PAGEOUT and future reclaim code report an explicit unsupported result instead of pretending that a page was evicted. Implementations must transfer frame ownership through FrameLease; callers never exchange a bare physical address.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§