pub struct CacheObject {
pub address: usize,
pub size: usize,
pub created_at: Instant,
pub last_access: Instant,
pub access_count: u32,
pub access_frequency: f64,
pub priority: ObjectPriority,
pub kernel_context: Option<u32>,
pub object_type: ObjectType,
pub eviction_cost: f64,
pub replacement_cost: f64,
}Expand description
Cached object representation
Fields§
§address: usizeObject address
size: usizeObject size
created_at: InstantCreation time
last_access: InstantLast access time
access_count: u32Access count
access_frequency: f64Access frequency (accesses per second)
priority: ObjectPriorityObject priority
kernel_context: Option<u32>GPU kernel context
object_type: ObjectTypeObject type
eviction_cost: f64Eviction cost (higher = more expensive to evict)
replacement_cost: f64Replacement cost (higher = more expensive to reload)
Implementations§
Source§impl CacheObject
impl CacheObject
Sourcepub fn update_access(&mut self)
pub fn update_access(&mut self)
Update access information
Sourcepub fn calculate_utility(&self) -> f64
pub fn calculate_utility(&self) -> f64
Calculate object utility score for eviction decisions
Trait Implementations§
Source§impl Clone for CacheObject
impl Clone for CacheObject
Source§fn clone(&self) -> CacheObject
fn clone(&self) -> CacheObject
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CacheObject
impl RefUnwindSafe for CacheObject
impl Send for CacheObject
impl Sync for CacheObject
impl Unpin for CacheObject
impl UnsafeUnpin for CacheObject
impl UnwindSafe for CacheObject
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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