pub trait ContainerRuntime:
Send
+ Sync
+ Clone
+ 'static {
// Required methods
fn create_container<'life0, 'async_trait>(
&'life0 self,
options: Option<CreateContainerOptions<String>>,
config: Config<String>,
) -> Pin<Box<dyn Future<Output = Result<ContainerCreateResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn start_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<StartContainerOptions<String>>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn stop_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<StopContainerOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn remove_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<RemoveContainerOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn wait_container(
&self,
container_name: &str,
options: Option<WaitContainerOptions<String>>,
) -> BoxStream<'static, Result<ContainerWaitResponse, Error>>;
fn create_volume<'life0, 'async_trait>(
&'life0 self,
config: CreateVolumeOptions<String>,
) -> Pin<Box<dyn Future<Output = Result<Volume, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_volume<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
options: Option<RemoveVolumeOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_image(
&self,
options: Option<CreateImageOptions<'static, String>>,
root_fs: Option<Bytes>,
credentials: Option<DockerCredentials>,
) -> BoxStream<'static, Result<CreateImageInfo, Error>>;
fn logs(
&self,
container_name: &str,
options: Option<LogsOptions<String>>,
) -> BoxStream<'static, Result<LogOutput, Error>>;
fn inspect_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<InspectContainerOptions>,
) -> Pin<Box<dyn Future<Output = Result<ContainerInspectResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_containers<'life0, 'async_trait>(
&'life0 self,
options: Option<ListContainersOptions<String>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ContainerSummary>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_volumes<'life0, 'async_trait>(
&'life0 self,
options: Option<ListVolumesOptions<String>>,
) -> Pin<Box<dyn Future<Output = Result<VolumeListResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A trait abstraction over Docker container runtime interactions.
Required Methods§
Sourcefn create_container<'life0, 'async_trait>(
&'life0 self,
options: Option<CreateContainerOptions<String>>,
config: Config<String>,
) -> Pin<Box<dyn Future<Output = Result<ContainerCreateResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_container<'life0, 'async_trait>(
&'life0 self,
options: Option<CreateContainerOptions<String>>,
config: Config<String>,
) -> Pin<Box<dyn Future<Output = Result<ContainerCreateResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a new container.
Sourcefn start_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<StartContainerOptions<String>>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<StartContainerOptions<String>>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Starts an existing container.
Sourcefn stop_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<StopContainerOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<StopContainerOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stops a running container.
Sourcefn remove_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<RemoveContainerOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<RemoveContainerOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes a container.
Sourcefn wait_container(
&self,
container_name: &str,
options: Option<WaitContainerOptions<String>>,
) -> BoxStream<'static, Result<ContainerWaitResponse, Error>>
fn wait_container( &self, container_name: &str, options: Option<WaitContainerOptions<String>>, ) -> BoxStream<'static, Result<ContainerWaitResponse, Error>>
Waits for a container to finish executing.
Sourcefn create_volume<'life0, 'async_trait>(
&'life0 self,
config: CreateVolumeOptions<String>,
) -> Pin<Box<dyn Future<Output = Result<Volume, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_volume<'life0, 'async_trait>(
&'life0 self,
config: CreateVolumeOptions<String>,
) -> Pin<Box<dyn Future<Output = Result<Volume, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a volume.
Sourcefn remove_volume<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
options: Option<RemoveVolumeOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_volume<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
options: Option<RemoveVolumeOptions>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes a volume.
Sourcefn create_image(
&self,
options: Option<CreateImageOptions<'static, String>>,
root_fs: Option<Bytes>,
credentials: Option<DockerCredentials>,
) -> BoxStream<'static, Result<CreateImageInfo, Error>>
fn create_image( &self, options: Option<CreateImageOptions<'static, String>>, root_fs: Option<Bytes>, credentials: Option<DockerCredentials>, ) -> BoxStream<'static, Result<CreateImageInfo, Error>>
Creates an image.
Sourcefn logs(
&self,
container_name: &str,
options: Option<LogsOptions<String>>,
) -> BoxStream<'static, Result<LogOutput, Error>>
fn logs( &self, container_name: &str, options: Option<LogsOptions<String>>, ) -> BoxStream<'static, Result<LogOutput, Error>>
Retrieves logs for a container.
Sourcefn inspect_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<InspectContainerOptions>,
) -> Pin<Box<dyn Future<Output = Result<ContainerInspectResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn inspect_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container_name: &'life1 str,
options: Option<InspectContainerOptions>,
) -> Pin<Box<dyn Future<Output = Result<ContainerInspectResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Inspects a container’s details.
Sourcefn list_containers<'life0, 'async_trait>(
&'life0 self,
options: Option<ListContainersOptions<String>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ContainerSummary>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_containers<'life0, 'async_trait>(
&'life0 self,
options: Option<ListContainersOptions<String>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ContainerSummary>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists containers.
Sourcefn list_volumes<'life0, 'async_trait>(
&'life0 self,
options: Option<ListVolumesOptions<String>>,
) -> Pin<Box<dyn Future<Output = Result<VolumeListResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_volumes<'life0, 'async_trait>(
&'life0 self,
options: Option<ListVolumesOptions<String>>,
) -> Pin<Box<dyn Future<Output = Result<VolumeListResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists volumes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.