pub struct OciLoader { /* private fields */ }Expand description
OciLoader loads an OCI app in preparation for running with Spin.
Implementations§
Source§impl OciLoader
impl OciLoader
Sourcepub fn new(working_dir: impl Into<PathBuf>) -> Self
pub fn new(working_dir: impl Into<PathBuf>) -> Self
Creates a new OciLoader which builds temporary mount directory(s) in the given working_dir.
Sourcepub async fn load_app(
&self,
client: &mut Client,
reference: &str,
) -> Result<ExecutableArtifact>
pub async fn load_app( &self, client: &mut Client, reference: &str, ) -> Result<ExecutableArtifact>
Pulls and loads an OCI Artifact and returns a LockedApp with the given OCI client and reference
Sourcepub async fn load_from_cache(
&self,
manifest: OciImageManifest,
lockfile_path: PathBuf,
reference: &str,
cache: &Cache,
) -> Result<ExecutableArtifact, Error>
pub async fn load_from_cache( &self, manifest: OciImageManifest, lockfile_path: PathBuf, reference: &str, cache: &Cache, ) -> Result<ExecutableArtifact, Error>
Loads an OCI Artifact from the given cache and returns a LockedApp with the given reference
Sourcepub async fn resolve_component_content_refs(
&self,
component: &mut LockedComponent,
cache: &Cache,
) -> Result<()>
pub async fn resolve_component_content_refs( &self, component: &mut LockedComponent, cache: &Cache, ) -> Result<()>
Resolves all digest references in the component (including source, dependencies,
and asset files). Wasm sources are replaced with cache paths. Asset files are
collected to a mount path, and the component files amended to reflect that.
This function assumes that:
- All resolvable items have digest or inline sources.
- All digest-addressed content is already in the cache.
If either of these is not true, the function errors.
Auto Trait Implementations§
impl Freeze for OciLoader
impl RefUnwindSafe for OciLoader
impl Send for OciLoader
impl Sync for OciLoader
impl Unpin for OciLoader
impl UnsafeUnpin for OciLoader
impl UnwindSafe for OciLoader
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more