Skip to main content

PagedCacheOptions

Struct PagedCacheOptions 

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

Validated finite limits for block-addressable mutable state.

Implementations§

Source§

impl PagedCacheOptions

Source

pub fn new( block_size_tokens: i32, device_budget_bytes: u64, host_budget_bytes: u64, recent_device_blocks: usize, ) -> Result<Self, CacheResidencyConfigurationError>

Creates paged-state limits. Every memory limit is finite and explicit.

Source

pub const fn with_full_attention(self, enabled: bool) -> Self

Enables exact blockwise full-context attention.

Source

pub const fn with_persistence_retention(self, enabled: bool) -> Self

Retains blocks older than a sliding window solely for later persistence.

Source

pub const fn with_eviction_policy(self, policy: CacheEvictionPolicy) -> Self

Selects deterministic block eviction ordering.

Source

pub fn with_live_disk( self, directory: impl Into<PathBuf>, budget_bytes: u64, queue_capacity: usize, ) -> Result<Self, CacheResidencyConfigurationError>

Configures explicit live disk backing.

Source

pub const fn with_process_sampling(self, enabled: bool) -> Self

Enables optional process-memory sampling in reports.

Source

pub fn with_pool( self, pool: CacheResidencyPool, ) -> Result<Self, CacheResidencyConfigurationError>

Attaches this per-cache policy to an aggregate process pool.

Source

pub const fn block_size_tokens(&self) -> i32

Returns the block size in tokens.

Source

pub const fn device_budget_bytes(&self) -> u64

Returns the finite logical device-cache budget.

Source

pub const fn host_budget_bytes(&self) -> u64

Returns the finite physical host-transfer allocation budget.

Source

pub const fn recent_device_blocks(&self) -> usize

Returns the recent block count protected on the execution device per layer.

Source

pub const fn eviction_policy(&self) -> CacheEvictionPolicy

Returns deterministic block eviction ordering.

Source

pub const fn full_attention_enabled(&self) -> bool

Returns whether exact blockwise full attention is enabled.

Source

pub const fn retains_discarded_for_persistence(&self) -> bool

Returns whether discarded sliding state is retained for persistence.

Source

pub const fn live_disk_policy(&self) -> &LiveCacheDiskPolicy

Returns the live disk policy.

Source

pub const fn process_sampling_enabled(&self) -> bool

Returns whether process-memory sampling is enabled.

Source

pub fn pool(&self) -> Option<&CacheResidencyPool>

Returns the explicitly attached aggregate pool, if any.

Source

pub fn create_pool( &self, ) -> Result<CacheResidencyPool, CacheResidencyConfigurationError>

Creates the default aggregate ownership pool for this policy.

Trait Implementations§

Source§

impl Clone for PagedCacheOptions

Source§

fn clone(&self) -> PagedCacheOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for PagedCacheOptions

Source§

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

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

impl Eq for PagedCacheOptions

Source§

impl PartialEq for PagedCacheOptions

Source§

fn eq(&self, other: &PagedCacheOptions) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PagedCacheOptions

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> CloneToUninit for T
where T: Clone,

Source§

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
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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, !>

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.