pub struct Cache { /* private fields */ }Expand description
Data that never changes for a live process, keyed by (pid, starttime).
Caching it is the single largest syscall reduction available;
docs/DESIGN.md §3.2.
Implementations§
Source§impl Cache
impl Cache
pub fn new() -> Self
pub fn get(&self, pid: Pid, starttime: u64) -> Option<&Stable>
pub fn insert(&mut self, pid: Pid, starttime: u64, stable: Stable)
Sourcepub fn retain_live(&mut self, live: &[(Pid, u64)])
pub fn retain_live(&mut self, live: &[(Pid, u64)])
Forget entries whose process is gone. Called once per tick with the set
of live (pid, starttime) keys.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cache
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnsafeUnpin for Cache
impl UnwindSafe for Cache
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> 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