Skip to main content

CacheLayout

Struct CacheLayout 

Source
pub struct CacheLayout { /* private fields */ }
Expand description

On-disk layout for bv’s local cache.

Implementations§

Source§

impl CacheLayout

Source

pub fn new() -> Self

Resolve the cache root.

Priority:

  1. BV_CACHE_DIR env var (used by tests and CI for isolation)
  2. $XDG_CACHE_HOME/bv if XDG_CACHE_HOME is set
  3. ~/.cache/bv (consistent across Linux and macOS)
Source

pub fn with_root(root: PathBuf) -> Self

Source

pub fn root(&self) -> &PathBuf

Source

pub fn image_dir(&self, digest: &str) -> PathBuf

<root>/images/<digest>/ - metadata we track alongside runtime storage.

Source

pub fn manifest_path(&self, tool_id: &str, version: &str) -> PathBuf

<root>/tools/<tool_id>/<version>/manifest.toml

Source

pub fn index_dir(&self, index_name: &str) -> PathBuf

<root>/index/<index_name>/ - local clones of git registries.

Source

pub fn data_dir(&self, dataset_id: &str, version: &str) -> PathBuf

<root>/data/<dataset_id>/<version>/

Source

pub fn sif_dir(&self) -> PathBuf

<root>/sif/ - Apptainer SIF image cache.

Source

pub fn tmp_dir(&self) -> PathBuf

<root>/tmp/ - staging area for atomic writes.

Trait Implementations§

Source§

impl Default for CacheLayout

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.