p2p_chat/ui/
mode.rs

1//! This module defines the different modes for the user interface.
2use tracing::Level;
3
4/// Represents the current mode of the user interface.
5#[derive(Debug, Clone)]
6pub enum UIMode {
7    /// The chat mode, where users can send and receive messages.
8    Chat,
9    /// The logs mode, where users can view and filter application logs.
10    Logs {
11        /// An optional filter string to apply to the logs.
12        filter: Option<String>,
13        /// The minimum log level to display.
14        level: Level,
15    },
16}
17
18impl Default for UIMode {
19    /// Returns the default UI mode, which is `Chat`.
20    fn default() -> Self {
21        Self::Chat
22    }
23}