/// Parse component url and return app created by launch function
/// # Arguments
/// * `args`: will be parsed to LaunchRequest
/// * `url`: url of the component
/// * `arguments`: optional arguments for the component
Parse component url and return app created by launch function
Parse component url and return app created by launch function
async fn create_launch_app(&self, args: Value) -> Result<client::App, Error> {
        let tag = "LaunchFacade::create_launch_app";
        let req: LaunchRequest = from_value(args)?;
        // Building the component url from the name of component.
        let component_url = match req.url {
            Some(x) => {
                fx_log_info!(
                    "Executing Launch {} in Launch Facade with arguments {:?}.",
                    x,
                    req.arguments
                );
                let url = format!("fuchsia-pkg://fuchsia.com/{}#meta/{}.cmx", x, x).to_string();
                url
            }
            None => return Err(format_err!("Need component url to launch")),
        };
        let launcher = match client::launcher() {
            Ok(r) => r,
            Err(err) => fx_err_and_bail!(
                &with_line!(tag),
                format_err!("Failed to get launcher service: {}", err)
            ),
        };
        let app = client::launch(&launcher, component_url.to_string(), req.arguments)?;
        Ok(app)
    }
async fn create_launch_app ( & self , args : Value ) -> Result < client :: App , Error > { let tag = " " ; let req : LaunchRequest = from_value ( args ) ? ; // Building the component url from the name of component. let component_url = match req . url { Some ( x ) => { fx_log_info ! ( " " x req arguments ) ; let url = format ! ( " " x x ) . to_string ( ) ; url } None => return Err ( format_err ! ( " " ) ) , } ; let launcher = match client :: launcher ( ) { Ok ( r ) => r , Err ( err ) => fx_err_and_bail ! ( with_line ( tag ) format_err ( " " err ) ) , } ; let app = client :: launch ( & launcher , component_url . to_string ( ) , req . arguments ) ? ; Ok ( app ) }
Parse component url and return app created by launch function
Parse component url and return app created by launch function
&self
args
Value