pub trait EventHandler: Sync + 'static {
// Provided methods
fn registry_request(&self, url: &str) { ... }
fn registry_auth(&self, url: &str) { ... }
fn download_start(&self, layers: usize, bytes: usize) { ... }
fn download_progress_bytes(&self, bytes: usize) { ... }
fn layer_start(&self, archive_length: u64) { ... }
fn layer_progress(&self, archive_position: usize) { ... }
fn layer_entry_skipped(&self, path: &Path, cause: &dyn Display) { ... }
fn finished(&self) { ... }
fn sandbox_status(&self, status: RestrictionStatus) { ... }
}Expand description
Handler to receive notifications for events during the unpack process.
All methods are optional.
Provided Methods§
Sourcefn registry_request(&self, url: &str)
fn registry_request(&self, url: &str)
HTTP request to the registry.
Sourcefn registry_auth(&self, url: &str)
fn registry_auth(&self, url: &str)
Registry requires an authentication token.
Sourcefn download_start(&self, layers: usize, bytes: usize)
fn download_start(&self, layers: usize, bytes: usize)
Start to download the blobs of the image.
layers is the number of layers to download.
bytes is the size of the data that is going to be downloaded.
Sourcefn download_progress_bytes(&self, bytes: usize)
fn download_progress_bytes(&self, bytes: usize)
Some data (in bytes) has been received.
This method is invoked very frequently.
Sourcefn layer_start(&self, archive_length: u64)
fn layer_start(&self, archive_length: u64)
Start to unpack a downloaded layer.
archive_length is the length, in bytes, of the archive
containing the layer.
Sourcefn layer_progress(&self, archive_position: usize)
fn layer_progress(&self, archive_position: usize)
A file was extracted from the archive and was written to the disk.
archive_position is relative to archive_length in
layer_start.
When archive_position == archive_length, the layer is fully
unpacked.
Sourcefn layer_entry_skipped(&self, path: &Path, cause: &dyn Display)
fn layer_entry_skipped(&self, path: &Path, cause: &dyn Display)
An entry in the archive’s layer is skipped.
For example, if it is an invalid entry type, like a block device.