Crate daemon_console

Crate daemon_console 

Source
Expand description

§daemon_console

A flexible console for daemon applications providing a terminal interface with command registration, history navigation, and colored logging.

§Examples

A simple way to create a TerminalApp instance.

use daemon_console::TerminalApp;
use std::io::stdout;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut app = TerminalApp::new();
    Ok(())
}

See more details in src/main.rs in source code.

Modules§

logger
Logging utilities with colored terminal output.

Macros§

get_critical
Macro for creating critical-level log messages.
get_debug
Macro for creating debug-level log messages.
get_error
Macro for creating error-level log messages.
get_info
Macro for creating info-level log messages.
get_warn
Macro for creating warning-level log messages.

Structs§

CommandResult
Result from command execution
TerminalApp
Main terminal application structure managing state and command execution.

Enums§

AppAction
Actions that can be sent from async commands to the main application

Traits§

AsyncCommandHandler
Trait for asynchronous command handlers that can be registered with the terminal application.
CommandHandler
Trait for synchronous command handlers that can be registered with the terminal application.