Crate hojicha_runtime

Crate hojicha_runtime 

Source
Expand description

§Hojicha Runtime

Event handling and async runtime for Hojicha TUI applications.

This crate provides the runtime infrastructure for handling events, managing async operations, and running the main application loop.

§Core Components

  • Program: Main application runtime and event loop
  • Event Processing: Priority-based event handling with backpressure
  • Async Support: Tokio-based async command execution
  • Subscriptions: Stream-based event sources
  • Error Resilience: Panic recovery and error handling

§Features

  • Priority event queue with automatic scaling
  • Resilient input handling with panic recovery
  • Safe mutex operations that recover from poison
  • Metrics and monitoring support
  • Terminal management and restoration

Re-exports§

pub use program::MouseMode;
pub use program::Program;
pub use program::ProgramOptions;
pub use async_handle::AsyncHandle;
pub use subscription::Subscription;
pub use program::CommandExecutor;
pub use program::EventProcessor;
pub use program::EventStats;
pub use program::FpsLimiter;
pub use program::PriorityConfig;
pub use program::PriorityEventProcessor;
pub use program::TerminalConfig;
pub use program::TerminalManager;

Modules§

async_handle
Handle for managing cancellable async operations Async operation handle with cancellation support
metrics
Advanced performance metrics and percentile latency tracking
panic_handler
Global panic handler for graceful TUI recovery
panic_recovery
Panic recovery utilities for Model trait methods
panic_utils
Utilities for consistent panic handling across the runtime
prelude
Prelude for convenient imports
priority_queue
Priority-based event queue with backpressure support
program
The main Program struct that runs the application
queue_scaling
Auto-scaling functionality for dynamic queue resizing
resilient_input
Resilient input handling with panic recovery
resource_limits
Resource limits and monitoring for async task execution
safe_mutex
Safe mutex wrapper that handles poison errors gracefully
safe_priority
Safe priority detection without unsafe transmutes
shared_runtime
Shared Tokio runtime for the entire application
stream_builders
Stream builder utilities for common async patterns
string_renderer
String-based terminal renderer with line diffing
subscription
Stream subscription support for async event sources
testing
Testing utilities for hojicha applications in the runtime crate

Macros§

test_runner
Macro to simplify test setup

Structs§

KeyEvent
A keyboard event
KeyModifiers
Represents key modifiers (shift, control, alt, etc.).
MouseEvent
A mouse event
WindowSize
Window size information

Enums§

Event
An event that can be received by the program
Key
Represents a key on the keyboard