pub fn open_project(&self, project_name: &str) {
        let logger = self.logger.clone_ref();
        let controller = self.controller.clone_ref();
        let name = project_name.to_owned();
        crate::executor::global::spawn(async move {
            if let Ok(managing_api) = controller.manage_projects() {
                match managing_api.list_projects().await {
                    Ok(projects) => {
                        let mut projects = projects.into_iter();
                        let project = projects.find(|project| project.name.as_ref() == name);
                        let uuid = project.map(|project| project.id);
                        if let Some(uuid) = uuid {
                            if let Err(err) = managing_api.open_project(uuid).await {
                                error!(logger, "Could not open open project `{name}`: {err}.");
                            }
                        } else {
                            error!(logger, "Could not find project `{name}`.")
                        }
                    }
                    Err(err) => error!(logger, "Could not list projects: {err}."),
                }
            } else {
                warning!(logger, "Project opening failed: no ProjectManagingAPI available.");
            }
        });
    }
/// Open a project by name. It makes two calls to Project Manager: one for listing projects and
/// a second one for opening the project.
Open a project by name. It makes two calls to Project Manager: one for listing projects and
a second one for opening the project.
Open a project by name . It makes two calls to Project Manager : one for listing projects and a second one for opening the project .
pub fn open_project(&self, project_name: &str) {
        let logger = self.logger.clone_ref();
        let controller = self.controller.clone_ref();
        let name = project_name.to_owned();
        crate::executor::global::spawn(async move {
            if let Ok(managing_api) = controller.manage_projects() {
                match managing_api.list_projects().await {
                    Ok(projects) => {
                        let mut projects = projects.into_iter();
                        let project = projects.find(|project| project.name.as_ref() == name);
                        let uuid = project.map(|project| project.id);
                        if let Some(uuid) = uuid {
                            if let Err(err) = managing_api.open_project(uuid).await {
                                error!(logger, "Could not open open project `{name}`: {err}.");
                            }
                        } else {
                            error!(logger, "Could not find project `{name}`.")
                        }
                    }
                    Err(err) => error!(logger, "Could not list projects: {err}."),
                }
            } else {
                warning!(logger, "Project opening failed: no ProjectManagingAPI available.");
            }
        });
    }
pub fn open_project ( & self , project_name : & str ) { let logger = self . logger . clone_ref ( ) ; let controller = self . controller . clone_ref ( ) ; let name = project_name . to_owned ( ) ; crate :: executor :: global :: spawn ( async move { if let Ok ( managing_api ) = controller . manage_projects ( ) { match managing_api . list_projects ( ) . await { Ok ( projects ) => { let mut projects = projects . into_iter ( ) ; let project = projects . find ( | project | project . name . as_ref ( ) == name ) ; let uuid = project . map ( | project | project . id ) ; if let Some ( uuid ) = uuid { if let Err ( err ) = managing_api . open_project ( uuid ) . await { error ! ( logger " " ) ; } } else { error ! ( logger " " ) } } Err ( err ) => error ! ( logger " " ) , } } else { warning ! ( logger " " ) ; } } ) ; }
Open a project by name.
Open a project by name .
&self
project_name
&str
&self
project_name
&str