pub fn run(assistant_creator_func: AssistantCreatorFunc) -> Result<(), Error> {
        let config = Self::load_config().context("loading config failed in run")?;
        let mut executor = fasync::LocalExecutor::new().context("Error creating executor")?;
        let (internal_sender, mut internal_receiver) = unbounded::<MessageInternal>();
        let f = async {
            let app_context = AppContext { sender: internal_sender.clone() };
            let assistant_creator = assistant_creator_func(&app_context);
            let assistant = assistant_creator.await?;
            let strat =
                create_app_strategy(&assistant, &config, FIRST_VIEW_KEY, &internal_sender).await?;
            let mut app = App::new(internal_sender, strat, assistant);
            app.app_init_common().await?;
            while let Some(message) = internal_receiver.next().await {
                app.handle_message(message).await.expect("handle_message failed");
            }
            Ok::<(), Error>(())
        };
        executor.run_singlethreaded(f)?;
        Ok(())
    }
/// Starts an application based on Carnelian. The `assistant` parameter will
/// be used to create new views when asked to do so by the Fuchsia view system.
Starts an application based on Carnelian. The `assistant` parameter will
be used to create new views when asked to do so by the Fuchsia view system.
Starts an application based on Carnelian . The ` assistant ` parameter will be used to create new views when asked to do so by the Fuchsia view system .
pub fn run(assistant_creator_func: AssistantCreatorFunc) -> Result<(), Error> {
        let config = Self::load_config().context("loading config failed in run")?;
        let mut executor = fasync::LocalExecutor::new().context("Error creating executor")?;
        let (internal_sender, mut internal_receiver) = unbounded::<MessageInternal>();
        let f = async {
            let app_context = AppContext { sender: internal_sender.clone() };
            let assistant_creator = assistant_creator_func(&app_context);
            let assistant = assistant_creator.await?;
            let strat =
                create_app_strategy(&assistant, &config, FIRST_VIEW_KEY, &internal_sender).await?;
            let mut app = App::new(internal_sender, strat, assistant);
            app.app_init_common().await?;
            while let Some(message) = internal_receiver.next().await {
                app.handle_message(message).await.expect("handle_message failed");
            }
            Ok::<(), Error>(())
        };
        executor.run_singlethreaded(f)?;
        Ok(())
    }
pub fn run ( assistant_creator_func : AssistantCreatorFunc ) -> Result < ( ) , Error > { let config = Self :: load_config ( ) . context ( " " ) ? ; let mut executor = fasync :: LocalExecutor :: new ( ) . context ( " " ) ? ; let ( internal_sender , mut internal_receiver ) = unbounded :: < MessageInternal > ( ) ; let f = async { let app_context = AppContext { sender : internal_sender . clone ( ) } ; let assistant_creator = assistant_creator_func ( & app_context ) ; let assistant = assistant_creator . await ? ; let strat = create_app_strategy ( & assistant , & config , FIRST_VIEW_KEY , & internal_sender ) . await ? ; let mut app = App :: new ( internal_sender , strat , assistant ) ; app . app_init_common ( ) . await ? ; while let Some ( message ) = internal_receiver . next ( ) . await { app . handle_message ( message ) . await . expect ( " " ) ; } Ok :: < ( ) , Error > ( ( ) ) } ; executor . run_singlethreaded ( f ) ? ; Ok ( ( ) ) }
Starts an application based on Carnelian.
Starts an application based on Carnelian .
assistant_creator_func
AssistantCreatorFunc
assistant_creator_func
AssistantCreatorFunc