Skip to main content

aeth_entry/
lib.rs

1use aeth_task::ready_poll::local_ready_poll;
2use aeth_task::{Handle, framework, spawn_foreground};
3
4/// Result type that is forwarded to make it easy
5/// for code generation.
6pub type Result<T> = anyhow::Result<T>;
7
8/// Intended entrypoint of aeth-rs.
9pub fn entrypoint<F>(future: F) -> Result<()>
10where
11    F: Future<Output = Result<()>> + 'static,
12{
13    let taskfx_cfg = framework::Config::default();
14    let taskfx = framework::initialize(taskfx_cfg)?;
15
16    let (main, poll) = local_ready_poll(future);
17    spawn_foreground(main).detach();
18
19    aeth_window::subsystem::run(taskfx, poll)?;
20    Ok(())
21}
22
23pub use aeth_entry_macros::main;