Module disk_usage

Module disk_usage 

Source
Expand description

Use ditto.disk_usage() to access the DiskUsage API to inspect Ditto’s disk usage.

§Monitor disk usage on a device

In order to persist data on a device, Ditto can create a local database in a folder specified via DittoConfig::persistence_directory.

To monitor this folder size, DiskUsage offers two methods:

  • .item() to retrieve an immediate DiskUsageItem tree and
  • .observe(...) to call a callback every time changes occur in the Ditto folder.

Structs§

DiskUsage
Used to monitor the disk usage of Ditto or of its sub-components.
DiskUsageItem
Represents an entry in the file system tree returned by DiskUsage.
DiskUsageObserver
Handle returned by DiskUsage::observe.

Enums§

FileSystemType
Represents the type of file system entry (directory, file, or symbolic link).

Traits§

DiskUsageCallback
An alias for 'static + Send + FnMut(DiskUsageItem). Callback bounds for the DiskUsage .observe(...) handler.

Type Aliases§

DiskUsageObserverHandle
Alias for the observer type returned by .observe(...).