pub struct PagingConfig {
pub max_memory: usize,
pub page_size: usize,
pub prefetch: bool,
pub prefetch_count: usize,
pub eviction: EvictionStrategy,
}Expand description
Configuration for paged model loading.
Fields§
§max_memory: usizeMaximum memory to use for cached model data (bytes).
page_size: usizePage size for loading (bytes).
prefetch: boolEnable pre-fetching of likely-needed pages.
prefetch_count: usizeNumber of pages to pre-fetch.
eviction: EvictionStrategyEviction strategy.
Implementations§
Source§impl PagingConfig
impl PagingConfig
Sourcepub fn with_max_memory(self, max_memory: usize) -> Self
pub fn with_max_memory(self, max_memory: usize) -> Self
Set maximum memory.
Note: The minimum is 1024 bytes to ensure meaningful paging behavior.
Sourcepub fn with_page_size(self, page_size: usize) -> Self
pub fn with_page_size(self, page_size: usize) -> Self
Set page size.
Sourcepub fn with_prefetch(self, prefetch: bool) -> Self
pub fn with_prefetch(self, prefetch: bool) -> Self
Enable or disable pre-fetching.
Sourcepub fn with_prefetch_count(self, count: usize) -> Self
pub fn with_prefetch_count(self, count: usize) -> Self
Set pre-fetch count.
Sourcepub fn with_eviction(self, strategy: EvictionStrategy) -> Self
pub fn with_eviction(self, strategy: EvictionStrategy) -> Self
Set eviction strategy.
Trait Implementations§
Source§impl Clone for PagingConfig
impl Clone for PagingConfig
Source§fn clone(&self) -> PagingConfig
fn clone(&self) -> PagingConfig
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PagingConfig
impl Debug for PagingConfig
Auto Trait Implementations§
impl Freeze for PagingConfig
impl RefUnwindSafe for PagingConfig
impl Send for PagingConfig
impl Sync for PagingConfig
impl Unpin for PagingConfig
impl UnwindSafe for PagingConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more