pub struct DiskCache { /* private fields */ }Expand description
Disk list and per-tick capacity for one storage collection path.
The view and API collection loops and LocalStorageReader each own one
and call storage_info once per tick. Rows are
selected, ordered and numbered exactly as Disks::new_with_refreshed_list
plus filter_docker_aware_disks always did; see the module docs for how
fresh each field is and how the two constructors differ on the first call.
Implementations§
Source§impl DiskCache
impl DiskCache
Sourcepub fn new() -> Self
pub fn new() -> Self
An empty cache for a collection loop. The first
storage_info call starts enumerating the mount
table in the background and waits at most 2 s for it; if the list is
not ready by then that call returns no rows, and the rows appear on
the first call after it is.
Sourcepub fn with_blocking_first_list() -> Self
pub fn with_blocking_first_list() -> Self
An empty cache whose first storage_info call
enumerates the mount table on the calling thread and returns the
complete list, however long that takes, as
Disks::new_with_refreshed_list does. Later calls behave as with
new. LocalStorageReader uses this so a library
caller never gets an empty first list from a slow enumeration.
Sourcepub fn storage_info(&mut self, hostname: &str) -> Vec<StorageInfo>
pub fn storage_info(&mut self, hostname: &str) -> Vec<StorageInfo>
Storage rows for this tick.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DiskCache
impl !Sync for DiskCache
impl !UnwindSafe for DiskCache
impl Forget for DiskCache
impl Freeze for DiskCache
impl Move for DiskCache
impl Send for DiskCache
impl Unpin for DiskCache
impl UnsafeUnpin for DiskCache
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request