Skip to main content

ZLayerDirs

Struct ZLayerDirs 

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

Centralized filesystem path resolution for ZLayer.

All ZLayer crates should use this instead of hardcoding paths.

Implementations§

Source§

impl ZLayerDirs

Source

pub fn new(data_dir: impl Into<PathBuf>) -> Self

Create from an explicit data directory.

Source

pub fn system_default() -> Self

Create using the platform default data directory.

Source

pub fn default_data_dir() -> PathBuf

Platform-aware default data directory.

  • macOS: ~/.zlayer
  • Linux (root): /var/lib/zlayer
  • Linux (user): ~/.zlayer
  • Windows: %LOCALAPPDATA%\ZLayer or C:\ProgramData\ZLayer
Source

pub fn default_run_dir() -> PathBuf

Default runtime directory.

  • Linux: /var/run/zlayer
  • macOS: {default_data_dir}/run
  • Windows: {default_data_dir}\run
Source

pub fn default_log_dir() -> PathBuf

Default log directory.

  • Linux: /var/log/zlayer
  • macOS: {default_data_dir}/logs
  • Windows: {default_data_dir}\logs
Source

pub fn default_socket_path() -> String

Default Unix socket path.

  • Linux: /var/run/zlayer.sock
  • macOS: {default_data_dir}/run/zlayer.sock
  • Windows: tcp://127.0.0.1:3669
Source

pub fn data_dir(&self) -> &Path

Root data directory.

Source

pub fn containers(&self) -> PathBuf

Container state directory ({data}/containers).

Source

pub fn rootfs(&self) -> PathBuf

Unpacked image rootfs directory ({data}/rootfs).

Source

pub fn bundles(&self) -> PathBuf

OCI bundle directory ({data}/bundles).

Source

pub fn cache(&self) -> PathBuf

Image/blob cache directory ({data}/cache).

Source

pub fn volumes(&self) -> PathBuf

Named volumes directory ({data}/volumes).

Source

pub fn wasm(&self) -> PathBuf

WASM module cache directory ({data}/wasm).

Source

pub fn wasm_compiled(&self) -> PathBuf

AOT-compiled WASM cache directory ({data}/wasm/compiled).

Source

pub fn secrets(&self) -> PathBuf

Encrypted secrets store directory ({data}/secrets).

Source

pub fn certs(&self) -> PathBuf

TLS certificate storage directory ({data}/certs).

Source

pub fn raft(&self) -> PathBuf

Raft consensus data directory ({data}/raft).

Source

pub fn admin_password(&self) -> PathBuf

Admin password file path ({data}/admin_password).

Source

pub fn daemon_json(&self) -> PathBuf

Daemon metadata file path ({data}/daemon.json).

Source

pub fn logs(&self) -> PathBuf

Logs subdirectory under data_dir ({data}/logs). Used on macOS where logs live under the user data dir.

Source

pub fn vms(&self) -> PathBuf

macOS VM state directory ({data}/vms).

Source

pub fn images(&self) -> PathBuf

OCI image storage directory ({data}/images).

Source

pub fn bin(&self) -> PathBuf

Local binary directory ({data}/bin).

Source

pub fn toolchain_cache(&self) -> PathBuf

Toolchain download cache directory ({data}/toolchain-cache).

Source

pub fn tmp(&self) -> PathBuf

Temporary build directory ({data}/tmp).

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.