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.

Re-exports§

pub use crate::command::AsyncCommandHandler;
pub use crate::command::AsyncUnknownCommandHandler;
pub use crate::command::CommandHandler;
pub use crate::command::CommandHandlerType;
pub use crate::command::CommandResult;
pub use crate::command::RunningCommand;
pub use crate::command::UnknownCommandHandler;

Modules§

command
events
logger
Logging utilities with colored terminal output.
utils

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§

TerminalApp
Main terminal application structure managing state and command execution.

Enums§

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