pub trait DockerApi: Send + Sync {
Show 25 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;
fn changes(
&self,
container: &str,
) -> impl Future<Output = Result<Vec<String>, Error>> + Send;
fn written(
&self,
container: &str,
) -> impl Future<Output = Result<u64, Error>> + Send;
fn commit(
&self,
container: &str,
reference: &str,
labels: BTreeMap<String, String>,
) -> impl Future<Output = Result<u64, Error>> + Send;
fn images(
&self,
label: &str,
) -> impl Future<Output = Result<Vec<Image>, Error>> + Send;
fn image_id(
&self,
reference: &str,
) -> impl Future<Output = Result<Option<String>, Error>> + Send;
fn tagged_images(
&self,
) -> impl Future<Output = Result<Vec<TaggedImage>, Error>> + Send;
fn container_images(
&self,
) -> impl Future<Output = Result<BTreeSet<String>, Error>> + Send;
fn remove_image(
&self,
reference: &str,
) -> impl Future<Output = Result<(), Error>> + Send;
fn free_space(&self) -> impl Future<Output = Result<u64, Error>> + Send;
fn shell(
&self,
name: &str,
body: ContainerCreateBody,
size: TtySize,
) -> impl Future<Output = Result<Tty, 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§
Sourcefn start(
&self,
spec: &RunnerSpec,
isolation: &dyn Isolation,
) -> impl Future<Output = Result<String, Error>> + Send
fn start( &self, spec: &RunnerSpec, isolation: &dyn Isolation, ) -> impl Future<Output = Result<String, Error>> + Send
Creates and starts a runner container; returns its ID.
Sourcefn inspect(
&self,
container: &str,
) -> impl Future<Output = Result<RunnerState, Error>> + Send
fn inspect( &self, container: &str, ) -> impl Future<Output = Result<RunnerState, Error>> + Send
A container’s state and isolation.
Sourcefn remove(
&self,
container: &str,
) -> impl Future<Output = Result<(), Error>> + Send
fn remove( &self, container: &str, ) -> impl Future<Output = Result<(), Error>> + Send
Removes a runner container, stopping it first if it runs.
Sourcefn run(
&self,
name: &str,
body: ContainerCreateBody,
) -> impl Future<Output = Result<String, Error>> + Send
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.
Sourcefn list(
&self,
label: &str,
) -> impl Future<Output = Result<Vec<Container>, Error>> + Send
fn list( &self, label: &str, ) -> impl Future<Output = Result<Vec<Container>, Error>> + Send
Every container, running or not, that has the label.
Sourcefn wait(
&self,
container: &str,
) -> impl Future<Output = Result<i64, Error>> + Send
fn wait( &self, container: &str, ) -> impl Future<Output = Result<i64, Error>> + Send
Waits for a container to exit; returns its exit code.
Sourcefn logs(
&self,
container: &str,
) -> impl Future<Output = Result<String, Error>> + Send
fn logs( &self, container: &str, ) -> impl Future<Output = Result<String, Error>> + Send
A container’s output so far, stdout and stderr interleaved.
Sourcefn logs_since(
&self,
container: &str,
since: u64,
) -> impl Future<Output = Result<String, Error>> + Send
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.
Sourcefn exec(
&self,
container: &str,
command: Vec<String>,
) -> impl Future<Output = Result<Output, Error>> + Send
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.
Sourcefn image_present(
&self,
image: &str,
) -> impl Future<Output = Result<bool, Error>> + Send
fn image_present( &self, image: &str, ) -> impl Future<Output = Result<bool, Error>> + Send
Whether Docker has an image.
Sourcefn pull(&self, image: &str) -> impl Future<Output = Result<(), Error>> + Send
fn pull(&self, image: &str) -> impl Future<Output = Result<(), Error>> + Send
Pulls an image, logging its progress every few seconds.
Sourcefn ensure_network(
&self,
name: &str,
) -> impl Future<Output = Result<(), Error>> + Send
fn ensure_network( &self, name: &str, ) -> impl Future<Output = Result<(), Error>> + Send
Creates a bridge network unless it exists.
Sourcefn ensure_volume(
&self,
name: &str,
) -> impl Future<Output = Result<(), Error>> + Send
fn ensure_volume( &self, name: &str, ) -> impl Future<Output = Result<(), Error>> + Send
Creates a volume unless it exists.
Sourcefn remove_volume(
&self,
name: &str,
) -> impl Future<Output = Result<(), Error>> + Send
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.
Sourcefn volume_sizes(
&self,
) -> impl Future<Output = Result<BTreeMap<String, u64>, Error>> + Send
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.
Sourcefn changes(
&self,
container: &str,
) -> impl Future<Output = Result<Vec<String>, Error>> + Send
fn changes( &self, container: &str, ) -> impl Future<Output = Result<Vec<String>, Error>> + Send
The paths a container’s own layer added or changed, not those it deleted.
Sourcefn written(
&self,
container: &str,
) -> impl Future<Output = Result<u64, Error>> + Send
fn written( &self, container: &str, ) -> impl Future<Output = Result<u64, Error>> + Send
The bytes a container’s own layer holds.
Sourcefn commit(
&self,
container: &str,
reference: &str,
labels: BTreeMap<String, String>,
) -> impl Future<Output = Result<u64, Error>> + Send
fn commit( &self, container: &str, reference: &str, labels: BTreeMap<String, String>, ) -> impl Future<Output = Result<u64, Error>> + Send
Commits a stopped container’s own layer as the image reference (repository:tag) with labels; returns
the disk the image takes beyond its parent.
Sourcefn images(
&self,
label: &str,
) -> impl Future<Output = Result<Vec<Image>, Error>> + Send
fn images( &self, label: &str, ) -> impl Future<Output = Result<Vec<Image>, Error>> + Send
Every image with the label.
Sourcefn image_id(
&self,
reference: &str,
) -> impl Future<Output = Result<Option<String>, Error>> + Send
fn image_id( &self, reference: &str, ) -> impl Future<Output = Result<Option<String>, Error>> + Send
The ID of the image a reference (tag, digest or ID) names; None when Docker does not have it.
Sourcefn tagged_images(
&self,
) -> impl Future<Output = Result<Vec<TaggedImage>, Error>> + Send
fn tagged_images( &self, ) -> impl Future<Output = Result<Vec<TaggedImage>, Error>> + Send
Every image Docker has a tag for.
Sourcefn container_images(
&self,
) -> impl Future<Output = Result<BTreeSet<String>, Error>> + Send
fn container_images( &self, ) -> impl Future<Output = Result<BTreeSet<String>, Error>> + Send
The image ID of every container, running or stopped.
Sourcefn remove_image(
&self,
reference: &str,
) -> impl Future<Output = Result<(), Error>> + Send
fn remove_image( &self, reference: &str, ) -> impl Future<Output = Result<(), Error>> + Send
Removes an image and the layers only it used; one that does not exist is not an error.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".