Skip to main content

DockerApi

Trait DockerApi 

Source
pub trait DockerApi: Send + Sync {
Show 15 methods // Required methods fn start( &self, spec: &RunnerSpec, isolation: &dyn Isolation, ) -> impl Future<Output = Result<String, Error>> + Send; fn inspect( &self, container: &str, ) -> impl Future<Output = Result<RunnerState, Error>> + Send; fn remove( &self, container: &str, ) -> impl Future<Output = Result<(), Error>> + Send; fn run( &self, name: &str, body: ContainerCreateBody, ) -> impl Future<Output = Result<String, Error>> + Send; fn list( &self, label: &str, ) -> impl Future<Output = Result<Vec<Container>, Error>> + Send; fn wait( &self, container: &str, ) -> impl Future<Output = Result<i64, Error>> + Send; fn logs( &self, container: &str, ) -> impl Future<Output = Result<String, Error>> + Send; fn logs_since( &self, container: &str, since: u64, ) -> impl Future<Output = Result<String, Error>> + Send; fn exec( &self, container: &str, command: Vec<String>, ) -> impl Future<Output = Result<Output, Error>> + Send; fn image_present( &self, image: &str, ) -> impl Future<Output = Result<bool, Error>> + Send; fn pull( &self, image: &str, ) -> impl Future<Output = Result<(), Error>> + Send; fn ensure_network( &self, name: &str, ) -> impl Future<Output = Result<(), Error>> + Send; fn ensure_volume( &self, name: &str, ) -> impl Future<Output = Result<(), Error>> + Send; fn remove_volume( &self, name: &str, ) -> impl Future<Output = Result<(), Error>> + Send; fn volume_sizes( &self, ) -> impl Future<Output = Result<BTreeMap<String, u64>, Error>> + Send;
}
Expand description

The Docker Engine calls the scheduler and the caches make. Docker is the real one; the engine’s tests use a fake.

Required Methods§

Source

fn start( &self, spec: &RunnerSpec, isolation: &dyn Isolation, ) -> impl Future<Output = Result<String, Error>> + Send

Creates and starts a runner container; returns its ID.

Source

fn inspect( &self, container: &str, ) -> impl Future<Output = Result<RunnerState, Error>> + Send

A container’s state and isolation.

Source

fn remove( &self, container: &str, ) -> impl Future<Output = Result<(), Error>> + Send

Removes a runner container, stopping it first if it runs.

Source

fn run( &self, name: &str, body: ContainerCreateBody, ) -> impl Future<Output = Result<String, Error>> + Send

Creates and starts a container that is not a runner, such as the mirror; returns its ID.

Source

fn list( &self, label: &str, ) -> impl Future<Output = Result<Vec<Container>, Error>> + Send

Every container, running or not, that has the label.

Source

fn wait( &self, container: &str, ) -> impl Future<Output = Result<i64, Error>> + Send

Waits for a container to exit; returns its exit code.

Source

fn logs( &self, container: &str, ) -> impl Future<Output = Result<String, Error>> + Send

A container’s output so far, stdout and stderr interleaved.

Source

fn logs_since( &self, container: &str, since: u64, ) -> impl Future<Output = Result<String, Error>> + Send

A container’s output since since (seconds since the epoch), each line prefixed with Docker’s RFC 3339 timestamp and a space.

Source

fn exec( &self, container: &str, command: Vec<String>, ) -> impl Future<Output = Result<Output, Error>> + Send

Runs a command as root in a running container; its stdout streams until it exits or the container stops. Its stderr is dropped.

Source

fn image_present( &self, image: &str, ) -> impl Future<Output = Result<bool, Error>> + Send

Whether Docker has an image.

Source

fn pull(&self, image: &str) -> impl Future<Output = Result<(), Error>> + Send

Pulls an image, logging its progress every few seconds.

Source

fn ensure_network( &self, name: &str, ) -> impl Future<Output = Result<(), Error>> + Send

Creates a bridge network unless it exists.

Source

fn ensure_volume( &self, name: &str, ) -> impl Future<Output = Result<(), Error>> + Send

Creates a volume unless it exists.

Source

fn remove_volume( &self, name: &str, ) -> impl Future<Output = Result<(), Error>> + Send

Removes a volume; a volume that does not exist is not an error.

Source

fn volume_sizes( &self, ) -> impl Future<Output = Result<BTreeMap<String, u64>, Error>> + Send

The disk size of every volume Docker knows, by name. Slow: Docker measures each volume.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§