pub struct PagedCacheOptions { /* private fields */ }Expand description
Validated finite limits for block-addressable mutable state.
Implementations§
Source§impl PagedCacheOptions
impl PagedCacheOptions
Sourcepub fn new(
block_size_tokens: i32,
device_budget_bytes: u64,
host_budget_bytes: u64,
recent_device_blocks: usize,
) -> Result<Self, CacheResidencyConfigurationError>
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.
Sourcepub const fn with_full_attention(self, enabled: bool) -> Self
pub const fn with_full_attention(self, enabled: bool) -> Self
Enables exact blockwise full-context attention.
Sourcepub const fn with_persistence_retention(self, enabled: bool) -> Self
pub const fn with_persistence_retention(self, enabled: bool) -> Self
Retains blocks older than a sliding window solely for later persistence.
Sourcepub const fn with_eviction_policy(self, policy: CacheEvictionPolicy) -> Self
pub const fn with_eviction_policy(self, policy: CacheEvictionPolicy) -> Self
Selects deterministic block eviction ordering.
Sourcepub fn with_live_disk(
self,
directory: impl Into<PathBuf>,
budget_bytes: u64,
queue_capacity: usize,
) -> Result<Self, CacheResidencyConfigurationError>
pub fn with_live_disk( self, directory: impl Into<PathBuf>, budget_bytes: u64, queue_capacity: usize, ) -> Result<Self, CacheResidencyConfigurationError>
Configures explicit live disk backing.
Sourcepub const fn with_process_sampling(self, enabled: bool) -> Self
pub const fn with_process_sampling(self, enabled: bool) -> Self
Enables optional process-memory sampling in reports.
Sourcepub fn with_pool(
self,
pool: CacheResidencyPool,
) -> Result<Self, CacheResidencyConfigurationError>
pub fn with_pool( self, pool: CacheResidencyPool, ) -> Result<Self, CacheResidencyConfigurationError>
Attaches this per-cache policy to an aggregate process pool.
Sourcepub const fn block_size_tokens(&self) -> i32
pub const fn block_size_tokens(&self) -> i32
Returns the block size in tokens.
Sourcepub const fn device_budget_bytes(&self) -> u64
pub const fn device_budget_bytes(&self) -> u64
Returns the finite logical device-cache budget.
Sourcepub const fn host_budget_bytes(&self) -> u64
pub const fn host_budget_bytes(&self) -> u64
Returns the finite physical host-transfer allocation budget.
Sourcepub const fn recent_device_blocks(&self) -> usize
pub const fn recent_device_blocks(&self) -> usize
Returns the recent block count protected on the execution device per layer.
Sourcepub const fn eviction_policy(&self) -> CacheEvictionPolicy
pub const fn eviction_policy(&self) -> CacheEvictionPolicy
Returns deterministic block eviction ordering.
Sourcepub const fn full_attention_enabled(&self) -> bool
pub const fn full_attention_enabled(&self) -> bool
Returns whether exact blockwise full attention is enabled.
Sourcepub const fn retains_discarded_for_persistence(&self) -> bool
pub const fn retains_discarded_for_persistence(&self) -> bool
Returns whether discarded sliding state is retained for persistence.
Sourcepub const fn live_disk_policy(&self) -> &LiveCacheDiskPolicy
pub const fn live_disk_policy(&self) -> &LiveCacheDiskPolicy
Returns the live disk policy.
Sourcepub const fn process_sampling_enabled(&self) -> bool
pub const fn process_sampling_enabled(&self) -> bool
Returns whether process-memory sampling is enabled.
Sourcepub fn pool(&self) -> Option<&CacheResidencyPool>
pub fn pool(&self) -> Option<&CacheResidencyPool>
Returns the explicitly attached aggregate pool, if any.
Sourcepub fn create_pool(
&self,
) -> Result<CacheResidencyPool, CacheResidencyConfigurationError>
pub fn create_pool( &self, ) -> Result<CacheResidencyPool, CacheResidencyConfigurationError>
Creates the default aggregate ownership pool for this policy.
Trait Implementations§
Source§impl Clone for PagedCacheOptions
impl Clone for PagedCacheOptions
Source§fn clone(&self) -> PagedCacheOptions
fn clone(&self) -> PagedCacheOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more