pub trait LayerSource:
Debug
+ Send
+ Sync {
// Required methods
fn fetch_layer<'a>(
&'a self,
manifest: &'a ImageManifest,
layer: &'a Descriptor,
progress: Option<&'a Sender<Option<LayerProgress>>>,
) -> BoxFuture<'a, Result<FetchedLayer<'a>>>;
fn finish(self: Box<Self>) -> BoxFuture<'static, Result<()>>;
}Expand description
Abstraction for layer blob data.
Typically ProxyLayerSource which pulls from a registry, but for deltas we reconstruct data directly from the delta.
Required Methods§
Sourcefn fetch_layer<'a>(
&'a self,
manifest: &'a ImageManifest,
layer: &'a Descriptor,
progress: Option<&'a Sender<Option<LayerProgress>>>,
) -> BoxFuture<'a, Result<FetchedLayer<'a>>>
fn fetch_layer<'a>( &'a self, manifest: &'a ImageManifest, layer: &'a Descriptor, progress: Option<&'a Sender<Option<LayerProgress>>>, ) -> BoxFuture<'a, Result<FetchedLayer<'a>>>
Open one layer of manifest for reading.
Sourcefn finish(self: Box<Self>) -> BoxFuture<'static, Result<()>>
fn finish(self: Box<Self>) -> BoxFuture<'static, Result<()>>
Release the source, at most once and after the last
Self::fetch_layer.
This is only reached when the import succeeds; an import that fails
part way through drops the source instead. Anything that must be
cleaned up either way belongs in a Drop impl.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".