pub struct OciCache { /* private fields */ }Expand description
Content-addressed cache for OCI binaries.
Default location: ~/.cache/cuenv/oci/
Structure:
~/.cache/cuenv/oci/
├── blobs/
│ └── sha256/
│ └── abc123... # Raw layer blobs
└── bin/
└── sha256/
└── def456... # Extracted binariesImplementations§
Source§impl OciCache
impl OciCache
Sourcepub fn binary_dir(&self, digest: &str) -> PathBuf
pub fn binary_dir(&self, digest: &str) -> PathBuf
Get the directory for a cached binary (by digest).
Binaries are stored as bin/<algo>/<hash>/<binary_name> so that
the directory can be added to PATH and the binary called by name.
Sourcepub fn binary_path(&self, digest: &str, binary_name: &str) -> PathBuf
pub fn binary_path(&self, digest: &str, binary_name: &str) -> PathBuf
Get the full path for a cached binary with its name.
Sourcepub fn has_binary(&self, digest: &str, binary_name: &str) -> bool
pub fn has_binary(&self, digest: &str, binary_name: &str) -> bool
Check if a binary is cached.
Sourcepub fn get_binary(&self, digest: &str, binary_name: &str) -> Option<PathBuf>
pub fn get_binary(&self, digest: &str, binary_name: &str) -> Option<PathBuf>
Get a cached binary if it exists.
Sourcepub fn store_blob(&self, digest: &str, source: &Path) -> Result<PathBuf>
pub fn store_blob(&self, digest: &str, source: &Path) -> Result<PathBuf>
Store a blob in the cache.
The blob is moved to the cache location.
Sourcepub fn store_binary(
&self,
digest: &str,
binary_name: &str,
source: &Path,
) -> Result<PathBuf>
pub fn store_binary( &self, digest: &str, binary_name: &str, source: &Path, ) -> Result<PathBuf>
Store a binary in the cache.
The binary is copied to the cache location with its proper name.
Sourcepub fn ensure_dirs(&self) -> Result<()>
pub fn ensure_dirs(&self) -> Result<()>
Ensure cache directories exist.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OciCache
impl RefUnwindSafe for OciCache
impl Send for OciCache
impl Sync for OciCache
impl Unpin for OciCache
impl UnsafeUnpin for OciCache
impl UnwindSafe for OciCache
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