pub struct DiskUsage { /* private fields */ }Expand description
Used to monitor the disk usage of Ditto or of its sub-components.
Access this through Ditto::disk_usage().
Implementations§
Source§impl DiskUsage
impl DiskUsage
Sourcepub fn item(&self) -> DiskUsageItem
pub fn item(&self) -> DiskUsageItem
Returns the current disk usage as a tree of DiskUsageItems.
This provides an immediate snapshot of the disk usage. For continuous monitoring,
use observe instead.
Sourcepub fn observe<F: DiskUsageCallback>(
&self,
callback: F,
) -> Arc<DiskUsageObserverHandle> ⓘ
pub fn observe<F: DiskUsageCallback>( &self, callback: F, ) -> Arc<DiskUsageObserverHandle> ⓘ
Register a callback to monitor the disk usage of the component.
The callback will be invoked whenever the disk usage changes. Keep the returned observer handle in scope to continue receiving updates. Drop the handle to stop observation.
Auto Trait Implementations§
impl Freeze for DiskUsage
impl RefUnwindSafe for DiskUsage
impl Send for DiskUsage
impl Sync for DiskUsage
impl Unpin for DiskUsage
impl UnwindSafe for DiskUsage
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