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§
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".