Template

Trait Template 

Source
pub trait Template: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn config(&self) -> &TemplateConfig;
    fn config_mut(&mut self) -> &mut TemplateConfig;

    // Provided methods
    fn build_command(&self) -> RunCommand { ... }
    fn start<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn stop<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn remove<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn is_running<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn logs<'life0, 'life1, 'async_trait>(
        &'life0 self,
        follow: bool,
        tail: Option<&'life1 str>,
    ) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn exec<'life0, 'life1, 'async_trait>(
        &'life0 self,
        command: Vec<&'life1 str>,
    ) -> Pin<Box<dyn Future<Output = Result<ExecOutput>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Trait for Docker container templates

Required Methods§

Source

fn name(&self) -> &str

Get the template name

Source

fn config(&self) -> &TemplateConfig

Get the template configuration

Source

fn config_mut(&mut self) -> &mut TemplateConfig

Get a mutable reference to the configuration

Provided Methods§

Source

fn build_command(&self) -> RunCommand

Build the RunCommand for this template

Source

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

Start the container with this template

Source

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

Stop the container

Source

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

Remove the container

Source

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

Check if the container is running

Source

fn logs<'life0, 'life1, 'async_trait>( &'life0 self, follow: bool, tail: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get container logs

Source

fn exec<'life0, 'life1, 'async_trait>( &'life0 self, command: Vec<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<ExecOutput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a command in the running container

Implementors§