async fn is_container_created(&self, name: &str) -> Result<bool, Error> {
        let containers: Vec<_> = self
            .list_containers(Some(ListContainersOptions {
                // Check for both running and non-running containers.
                all: true,
                // FIXME: This filter seems to filter by substring. That's... not reliable.
                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_created {:#?}", 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 has been created (running or otherwise).
Check whether a container has been created (running or otherwise).
Check whether a container has been created ( running or otherwise ) .
async fn is_container_created(&self, name: &str) -> Result<bool, Error> {
        let containers: Vec<_> = self
            .list_containers(Some(ListContainersOptions {
                // Check for both running and non-running containers.
                all: true,
                // FIXME: This filter seems to filter by substring. That's... not reliable.
                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_created {:#?}", 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_created ( & self , name : & str ) -> Result < bool , Error > { let containers : Vec < _ > = self . list_containers ( Some ( ListContainersOptions { // Check for both running and non-running containers. all : true , // FIXME: This filter seems to filter by substring. That's... not reliable. 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 has been created (running or otherwise).
Check whether a container has been created ( running or otherwise ) .
&self
name
&str
&self
name
&str