Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

Config

Struct Config 

Source
pub struct Config<const CATEGORIES: usize> {
    pub pools: [PoolConfig; CATEGORIES],
    pub categories: [CategoryConfig; CATEGORIES],
    pub max_in_flight: u8,
    pub step_budget: u32,
    pub backoff: Backoff,
    pub displace_margin: u32,
    pub max_victim_tier: [u8; 5],
    pub protect_wanted: [bool; 5],
    pub cancel_for_demand: bool,
}
Expand description

Everything configurable about a crate::Residency. CATEGORIES is both the number of category numbers in use and the number of pools.

Fields§

§pools: [PoolConfig; CATEGORIES]

Page pools, indexed by pool number.

§categories: [CategoryConfig; CATEGORIES]

Category budgets, indexed by crate::Category::number. A key whose category number is out of range is ignored (and counted).

§max_in_flight: u8

Requests the transport may hold at once (the design’s queue depth is 2). Cancelling requests do not count.

§step_budget: u32

Bookkeeping budget per crate::Residency::step, in work units (see the crate docs). u32::MAX means unlimited.

§backoff: Backoff

Retry schedule for failed reads and installs.

§displace_margin: u32

A wanted entry of the same class as a requester is displaced only when it is farther than the requester by more than this (distance units), so two entries of nearly equal distance cannot trade places each frame.

§max_victim_tier: [u8; 5]

Per requester class, the highest victim tier it may evict: 0 is an unwanted entry beyond the keep radius, 1 an unwanted entry inside the hysteresis band, 2 a wanted entry of lower priority than the requester. Indexed by Class::as_index.

§protect_wanted: [bool; 5]

Per class, whether an entry wanted at that class this frame can never be evicted this frame. Indexed by Class::as_index.

§cancel_for_demand: bool

Let a Class::Demand miss cancel the least urgent in-flight request when the transport is at depth.

Implementations§

Source§

impl<const CATEGORIES: usize> Config<CATEGORIES>

Source

pub const fn new() -> Self

All pools and categories disabled, the design’s default knobs: queue depth 2, unlimited step budget, the grid backoff, tiers [2, 2, 1, 0, 0], demand and combat fill protected, cancel for demand.

Trait Implementations§

Source§

impl<const CATEGORIES: usize> Clone for Config<CATEGORIES>

Source§

fn clone(&self) -> Config<CATEGORIES>

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const CATEGORIES: usize> Debug for Config<CATEGORIES>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<const CATEGORIES: usize> Default for Config<CATEGORIES>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<const CATEGORIES: usize> PartialEq for Config<CATEGORIES>

Source§

fn eq(&self, other: &Config<CATEGORIES>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const CATEGORIES: usize> Copy for Config<CATEGORIES>

Source§

impl<const CATEGORIES: usize> Eq for Config<CATEGORIES>

Source§

impl<const CATEGORIES: usize> StructuralPartialEq for Config<CATEGORIES>

Auto Trait Implementations§

§

impl<const CATEGORIES: usize> Freeze for Config<CATEGORIES>

§

impl<const CATEGORIES: usize> RefUnwindSafe for Config<CATEGORIES>

§

impl<const CATEGORIES: usize> Send for Config<CATEGORIES>

§

impl<const CATEGORIES: usize> Sync for Config<CATEGORIES>

§

impl<const CATEGORIES: usize> Unpin for Config<CATEGORIES>

§

impl<const CATEGORIES: usize> UnsafeUnpin for Config<CATEGORIES>

§

impl<const CATEGORIES: usize> UnwindSafe for Config<CATEGORIES>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.