EventHandler

Trait EventHandler 

Source
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§

Source

fn registry_request(&self, url: &str)

HTTP request to the registry.

Source

fn registry_auth(&self, url: &str)

Registry requires an authentication token.

Source

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.

Source

fn download_progress_bytes(&self, bytes: usize)

Some data (in bytes) has been received.

This method is invoked very frequently.

Source

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.

Source

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.

Source

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.

Source

fn finished(&self)

All layers have been unpacked.

Source

fn sandbox_status(&self, status: RestrictionStatus)

Implementors§