pub struct AccessRecord {
pub key: String,
pub timestamp: Instant,
pub coordinates: Option<(usize, usize, usize)>,
pub size: Option<usize>,
pub latency: Option<Duration>,
pub cache_hit: bool,
}Expand description
Access record for pattern analysis
Fields§
§key: StringAccessed key/path
timestamp: InstantAccess timestamp
coordinates: Option<(usize, usize, usize)>Access coordinates for spatial data (x, y, z/level)
size: Option<usize>Size of accessed data in bytes
latency: Option<Duration>Access latency (time to fetch)
cache_hit: boolWhether this was a cache hit
Implementations§
Source§impl AccessRecord
impl AccessRecord
Sourcepub fn with_coordinates(key: String, x: usize, y: usize, z: usize) -> Self
pub fn with_coordinates(key: String, x: usize, y: usize, z: usize) -> Self
Creates an access record with coordinates
Sourcepub fn with_latency(self, latency: Duration) -> Self
pub fn with_latency(self, latency: Duration) -> Self
Sets the access latency
Sourcepub fn with_cache_hit(self, hit: bool) -> Self
pub fn with_cache_hit(self, hit: bool) -> Self
Sets whether this was a cache hit
Trait Implementations§
Source§impl Clone for AccessRecord
impl Clone for AccessRecord
Source§fn clone(&self) -> AccessRecord
fn clone(&self) -> AccessRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AccessRecord
impl RefUnwindSafe for AccessRecord
impl Send for AccessRecord
impl Sync for AccessRecord
impl Unpin for AccessRecord
impl UnsafeUnpin for AccessRecord
impl UnwindSafe for AccessRecord
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