Skip to main content

DockerCli

Struct DockerCli 

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

Runs the docker CLI (with the Compose plugin). It honours DOCKER_HOST and the current Docker context like the CLI does; with_context pins one.

Implementations§

Source§

impl DockerCli

Source

pub fn new() -> Self

The docker on PATH, under the current context.

Source

pub fn with_program(self, program: impl Into<PathBuf>) -> Self

Run program instead of docker (e.g. an absolute path).

Source

pub fn with_context(self, context: impl Into<String>) -> Self

Talk to the daemon of Docker context context (docker --context <context>).

Trait Implementations§

Source§

impl Clone for DockerCli

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 ComposeEngine for DockerCli

Source§

fn up<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, opts: &'life2 UpOptions, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Create and start the project in dir (docker compose up -d).
Source§

fn down<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, opts: &'life2 DownOptions, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Stop and remove the project in dir (docker compose down).
Source§

fn ls<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ProjectStatus>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every project Docker knows of, running or stopped (docker compose ls --all).
Source§

fn ps<'life0, 'life1, 'async_trait>( &'life0 self, project: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<ServiceStatus>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The containers of project, running or stopped (docker compose ps --all).
Source§

fn logs<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, project: &'life1 str, opts: &'life2 LogOptions, ) -> Pin<Box<dyn Future<Output = Result<EngineStream<LogLine>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

The log lines of project’s containers (docker compose logs --timestamps).
Source§

fn events<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 EventFilter, ) -> Pin<Box<dyn Future<Output = Result<EngineStream<EngineEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Container events of the projects filter picks, from now on (docker events).
Source§

fn network_rm<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove the network name; Ok(false) when it doesn’t exist or is still in use.
Source§

impl Debug for DockerCli

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for DockerCli

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