pub struct PooledFragment {
pub id: u64,
pub key: String,
pub data: Arc<Vec<u8>>,
pub hash: u64,
pub size: u64,
pub created_at: Instant,
pub last_accessed: Instant,
pub access_count: AtomicU64,
}Expand description
A pooled fragment
Fields§
§id: u64Fragment ID
key: StringFragment key
data: Arc<Vec<u8>>Fragment data
hash: u64Content hash for deduplication
size: u64Size in bytes
created_at: InstantCreation time
last_accessed: InstantLast access time
access_count: AtomicU64Access count
Implementations§
Source§impl PooledFragment
impl PooledFragment
Sourcepub fn record_access(&self)
pub fn record_access(&self)
Record access
Sourcepub fn get_access_count(&self) -> u64
pub fn get_access_count(&self) -> u64
Get access count
Sourcepub fn is_expired(&self, expiry_seconds: u64) -> bool
pub fn is_expired(&self, expiry_seconds: u64) -> bool
Check if expired
Trait Implementations§
Source§impl Clone for PooledFragment
impl Clone for PooledFragment
Auto Trait Implementations§
impl !Freeze for PooledFragment
impl RefUnwindSafe for PooledFragment
impl Send for PooledFragment
impl Sync for PooledFragment
impl Unpin for PooledFragment
impl UnwindSafe for PooledFragment
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