Rust multi-platform application engine
- Make sure to have installed cargo and the latest version of rustc;
- Create new project with cargo new ;
- Get latest version of sunset engine and place it next to your newly created project:
- Add Sunset engine to your project's dependencies (in Cargo.toml inside your newly created project):
[dependencies]
sunset = { path = "../sunset" }- Configure your main application and run the sunset state:
use state::State;
use sunset::prelude::*;
fn main() {
let cli = cli::CLI {
commands: vec![],
context: cli::CLIContext,
};
// Functions need to be polled somehow, I have used pollster (which sunset re-exports), but tokio or any runtime can be used
sunset::pollster::block_on(State::insert_app("CLI", Box::new(cli)));
sunset::pollster::block_on(state::run());
}- To run your app open a terminal in your project's folder and type
cargo run
