Skip to main content

ContainerRuntime

Trait ContainerRuntime 

Source
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§

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn wait_container( &self, container_name: &str, options: Option<WaitContainerOptions<String>>, ) -> BoxStream<'static, Result<ContainerWaitResponse, Error>>

Waits for a container to finish executing.

Source

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.

Source

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.

Source

fn create_image( &self, options: Option<CreateImageOptions<'static, String>>, root_fs: Option<Bytes>, credentials: Option<DockerCredentials>, ) -> BoxStream<'static, Result<CreateImageInfo, Error>>

Creates an image.

Source

fn logs( &self, container_name: &str, options: Option<LogsOptions<String>>, ) -> BoxStream<'static, Result<LogOutput, Error>>

Retrieves logs for a container.

Source

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.

Source

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.

Source

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.

Implementations on Foreign Types§

Source§

impl ContainerRuntime for Docker

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

fn wait_container( &self, container_name: &str, options: Option<WaitContainerOptions<String>>, ) -> BoxStream<'static, Result<ContainerWaitResponse, Error>>

Source§

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,

Source§

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,

Source§

fn create_image( &self, options: Option<CreateImageOptions<'static, String>>, root_fs: Option<Bytes>, credentials: Option<DockerCredentials>, ) -> BoxStream<'static, Result<CreateImageInfo, Error>>

Source§

fn logs( &self, container_name: &str, options: Option<LogsOptions<String>>, ) -> BoxStream<'static, Result<LogOutput, Error>>

Source§

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,

Source§

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,

Source§

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,

Implementors§