Skip to main content

Module messages

Module messages 

Source
Expand description

Centralized message management system for kasl application.

Provides a comprehensive message handling infrastructure that serves as the foundation for all user communication in the kasl application.

§Features

  • Type Safety: All messages are compile-time verified with proper parameters
  • Centralization: Single source of truth for all user-facing text
  • Consistency: Uniform formatting and presentation across the application
  • Extensibility: Easy addition of new message types and categories
  • Internationalization: Structure supports future localization efforts

§Usage

use kasl::libs::messages::{Message, success, error};
use kasl::{msg_info, msg_error, msg_success};

msg_success!(Message::TaskCreated);
msg_error!(Message::ConfigSaveError);
msg_info!(Message::MonitorStarted {
    pause_threshold: 60,
    poll_interval: 500,
    activity_threshold: 30,
});

Re-exports§

pub use types::Message;

Modules§

display
Display implementation for kasl application messages.
macros
Convenient macros for application messaging and logging.
types
Message type definitions for the kasl application.

Functions§

error
Creates an error message with a red X prefix.
info
Creates an informational message with a blue info icon prefix.
success
Creates a success message with a green checkmark prefix.
warning
Creates a warning message with a yellow warning triangle prefix.
wrap_msg
Wraps a message with newlines for emphasis and visual separation.