async fn is_container_running(&self, name: &str) -> Result<bool, Error> {
        let containers = self
            .list_containers(Some(ListContainersOptions {
                // Check for running containers only
                all: false,
                filters: vec![("name", vec![name])].into_iter().collect(),
                ..ListContainersOptions::default()
            }))
            .await?;
        // `filters` actually filter by substring, so we need to double-check the result.
        debug!("is_container_running {:#?}", containers);
        let found = containers
            .into_iter()
            .flat_map(|container| container.names)
            .flat_map(|names| names.into_iter())
            .any(|container_name| container_name.as_str() == name);
        Ok(found)
    }
/// Check whether a container is currently running.
Check whether a container is currently running.
Check whether a container is currently running .
async fn is_container_running(&self, name: &str) -> Result<bool, Error> {
        let containers = self
            .list_containers(Some(ListContainersOptions {
                // Check for running containers only
                all: false,
                filters: vec![("name", vec![name])].into_iter().collect(),
                ..ListContainersOptions::default()
            }))
            .await?;
        // `filters` actually filter by substring, so we need to double-check the result.
        debug!("is_container_running {:#?}", containers);
        let found = containers
            .into_iter()
            .flat_map(|container| container.names)
            .flat_map(|names| names.into_iter())
            .any(|container_name| container_name.as_str() == name);
        Ok(found)
    }
async fn is_container_running ( & self , name : & str ) -> Result < bool , Error > { let containers = self . list_containers ( Some ( ListContainersOptions { // Check for running containers only all : false , filters : vec ! [ ( " " vec [ name ] ) ] . into_iter ( ) . collect ( ) , .. ListContainersOptions :: default ( ) } ) ) . await ? ; // `filters` actually filter by substring, so we need to double-check the result. debug ! ( " " containers ) ; let found = containers . into_iter ( ) . flat_map ( | container | container . names ) . flat_map ( | names | names . into_iter ( ) ) . any ( | container_name | container_name . as_str ( ) == name ) ; Ok ( found ) }
Check whether a container is currently running.
Check whether a container is currently running .
&self
name
&str
&self
name
&str