Skip to main content

Project

Struct Project 

Source
pub struct Project {
    pub name: String,
    pub file: ComposeFile,
    pub base_dir: PathBuf,
    pub files: Vec<PathBuf>,
    pub vars: BTreeMap<String, String>,
    pub dotenv: BTreeMap<String, String>,
    pub store_secrets: SecretValues,
}
Expand description

A loaded, interpolated, merged compose project.

Fields§

§name: String

Project name (default sandbox names are <name>-<service>).

§file: ComposeFile

The merged file, with every service’s container_name and every volume’s name filled in.

§base_dir: PathBuf

Directory of the first file: relative bind paths resolve against it.

§files: Vec<PathBuf>§vars: BTreeMap<String, String>

Explicit variables and the env files’ values, kept so that secrets with environment: resolve the way ${VAR} did.

§dotenv: BTreeMap<String, String>§store_secrets: SecretValues

Values of the secrets that come from the org’s store (external, age, driver), read by the caller before up (Project::store_backed_secrets says which).

Implementations§

Source§

impl Project

Source

pub fn service(&self, service: &str) -> Result<&SandboxSpec>

A sandbox by service name.

Source

pub fn select(&self, services: &[String]) -> Result<Vec<String>>

Service names in dependency order, or the given subset (validated) plus what it depends on, as docker compose up web also starts web’s dependencies.

Source

pub fn select_exact(&self, services: &[String]) -> Result<Vec<String>>

Exactly the given services (all when empty), validated, in dependency order. For commands that should not pull in dependencies (down, ps).

Source

pub fn files_display(&self) -> String

Source

pub fn lookup(&self, k: &str) -> Option<String>

A variable as interpolation sees it: explicit vars, then the environment, then the env files.

Source

pub fn secret_values(&self) -> Result<BTreeMap<String, Vec<u8>>>

The values of the secrets the services use: file: and environment: ones read here, the rest from Project::store_secrets.

Source

pub fn store_backed_secrets(&self) -> BTreeMap<String, SecretDef>

The secrets the services use whose values come from the org’s store and the daemon’s key (external, age, driver).

Source

pub fn to_yaml(&self) -> Result<String>

The resolved project as YAML (what isb config prints).

Trait Implementations§

Source§

impl Clone for Project

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Project

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V