execute

Function execute 

Source
pub fn execute<F>(future: F) -> Result<()>
where F: Future<Output = Result<()>>,
Expand description

Execute an async function in a sync context

This creates a new Tokio runtime and blocks on the provided future. Used by CLI commands to bridge to async domain functions.

§Examples

use ggen_utils::error::Result;

fn sync_command() -> Result<()> {
    crate::runtime::execute(async {
        // Async domain logic here
        Ok(())
    })
}