Crates.io | hojicha-runtime |
lib.rs | hojicha-runtime |
version | 0.2.2 |
created_at | 2025-08-11 19:18:00.591479+00 |
updated_at | 2025-08-29 17:13:00.377072+00 |
description | Event handling and async runtime for Hojicha TUI framework |
homepage | https://jgok76.gitea.cloud/femtomc/hojicha |
repository | https://jgok76.gitea.cloud/femtomc/hojicha |
max_upload_size | |
id | 1790707 |
size | 308,376 |
Event loop and async runtime for the Hojicha TUI framework.
This crate provides the runtime engine that powers Hojicha applications:
use hojicha_runtime::Program;
use hojicha_core::Model;
// Assuming you have a Model implementation
struct MyApp { /* ... */ }
impl Model for MyApp { /* ... */ }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Install panic handler for clean terminal restoration
hojicha_runtime::panic_handler::install();
// Create and run your application
let app = MyApp::new();
let mut program = Program::new(app)?;
program.run().await?;
Ok(())
}
init_async_bridge()
futures::Stream
with subscribe()
spawn_cancellable()
The runtime includes panic recovery to restore the terminal on application panic.
Test harness utilities for behavioral testing.
For full documentation and more examples, see the main Hojicha documentation.
GPL-3.0 - See LICENSE file for details