Trait DockerClient

Source
pub trait DockerClient: Send + Sync {
    // Required methods
    fn create_container<'life0, 'async_trait>(
        &'life0 self,
        options: Option<CreateContainerOptions<String>>,
        config: Config<String>,
    ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn start_container<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn wait_container<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn logs<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        options: Option<LogsOptions<String>>,
    ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn logs_stream<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        options: Option<LogsOptions<String>>,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<String, String>> + Send + Unpin>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove_container<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        options: Option<RemoveContainerOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_network<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn network_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn build_image<'life0, 'async_trait>(
        &'life0 self,
        options: BuildImageOptions<String>,
        tar_archive: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<String, String>> + Send + Unpin>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn image_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tag: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn create_container<'life0, 'async_trait>( &'life0 self, options: Option<CreateContainerOptions<String>>, config: Config<String>, ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn start_container<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn wait_container<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn logs<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, options: Option<LogsOptions<String>>, ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn logs_stream<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, options: Option<LogsOptions<String>>, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<String, String>> + Send + Unpin>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn remove_container<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, options: Option<RemoveContainerOptions>, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn create_network<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn network_exists<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn build_image<'life0, 'async_trait>( &'life0 self, options: BuildImageOptions<String>, tar_archive: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<String, String>> + Send + Unpin>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Build a Docker image from a tar archive containing a Dockerfile and associated files with streaming output

§Arguments
  • options - Build options including image tag, build args, and cache settings
  • tar_archive - Tar archive containing Dockerfile and any additional files
§Returns

A stream of build output messages, or an error if the build fails to start

Source

fn image_exists<'life0, 'life1, 'async_trait>( &'life0 self, tag: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a Docker image exists locally

§Arguments
  • tag - The image tag to check (e.g., “tsk/rust/claude/web-api”)
§Returns

True if the image exists, false otherwise

Implementors§