pub struct OciImage { /* private fields */ }Expand description
Represents an OCI image loaded from disk.
Implementations§
Source§impl OciImage
impl OciImage
Sourcepub fn from_path(path: impl AsRef<Path>) -> Result<Self>
pub fn from_path(path: impl AsRef<Path>) -> Result<Self>
Load an OCI image from a directory.
The directory must contain a valid OCI image layout:
- oci-layout file
- index.json
- blobs/sha256/ directory with manifest, config, and layers
§Arguments
path- Path to the OCI image directory
§Errors
Returns error if:
- Directory doesn’t exist
- OCI layout is invalid
- Manifest or config cannot be parsed
Sourcepub fn config(&self) -> &OciImageConfig
pub fn config(&self) -> &OciImageConfig
Get the image configuration.
Sourcepub fn layer_paths(&self) -> &[PathBuf]
pub fn layer_paths(&self) -> &[PathBuf]
Get paths to all layer blobs (in order, bottom to top).
Sourcepub fn manifest_digest(&self) -> &str
pub fn manifest_digest(&self) -> &str
Get the manifest digest (e.g. "sha256:abc123...").
Sourcepub fn entrypoint(&self) -> Option<&[String]>
pub fn entrypoint(&self) -> Option<&[String]>
Get the entrypoint command.
Returns the entrypoint from config, or None if not set.
Sourcepub fn working_dir(&self) -> Option<&str>
pub fn working_dir(&self) -> Option<&str>
Get the working directory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OciImage
impl RefUnwindSafe for OciImage
impl Send for OciImage
impl Sync for OciImage
impl Unpin for OciImage
impl UnsafeUnpin for OciImage
impl UnwindSafe for OciImage
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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