pub struct AppState {Show 32 fields
pub config: SerialConfig,
pub message_log: MessageLog,
pub display_mode: DisplayMode,
pub is_connected: bool,
pub config_locked: bool,
pub ports: Vec<String>,
pub scroll_offset: u16,
pub auto_scroll: bool,
pub port_list_state: ListState,
pub baud_rate_options: Vec<u32>,
pub baud_rate_state: ListState,
pub parity_options: Vec<Parity>,
pub parity_state: ListState,
pub flow_control_options: Vec<FlowControl>,
pub flow_control_state: ListState,
pub data_bits_options: Vec<u8>,
pub data_bits_state: ListState,
pub stop_bits_options: Vec<u8>,
pub stop_bits_state: ListState,
pub tx_input: String,
pub tx_mode: TxMode,
pub tx_append_mode: AppendMode,
pub tx_cursor: usize,
pub append_mode_options: Vec<AppendMode>,
pub append_mode_state: ListState,
pub focused_field: FocusedField,
pub notifications: VecDeque<Notification>,
pub debug_mode: bool,
pub last_mouse_event: String,
pub menu_state: MenuState,
pub language: Language,
pub show_shortcuts_help: bool,
}Expand description
Main application state
Fields§
§config: SerialConfig§message_log: MessageLog§display_mode: DisplayMode§is_connected: bool§config_locked: bool§ports: Vec<String>§scroll_offset: u16§auto_scroll: bool§port_list_state: ListState§baud_rate_options: Vec<u32>§baud_rate_state: ListState§parity_options: Vec<Parity>§parity_state: ListState§flow_control_options: Vec<FlowControl>§flow_control_state: ListState§data_bits_options: Vec<u8>§data_bits_state: ListState§stop_bits_options: Vec<u8>§stop_bits_state: ListState§tx_input: String§tx_mode: TxMode§tx_append_mode: AppendMode§tx_cursor: usize§append_mode_options: Vec<AppendMode>§append_mode_state: ListState§focused_field: FocusedField§notifications: VecDeque<Notification>§debug_mode: bool§last_mouse_event: String§language: Language§show_shortcuts_help: boolImplementations§
Source§impl AppState
impl AppState
Sourcepub fn lock_config(&mut self)
pub fn lock_config(&mut self)
Lock configuration (called when connecting)
Sourcepub fn unlock_config(&mut self)
pub fn unlock_config(&mut self)
Unlock configuration (called when disconnecting)
Sourcepub fn can_modify_config(&self) -> bool
pub fn can_modify_config(&self) -> bool
Check if configuration can be modified
Sourcepub fn add_notification(&mut self, notification: Notification)
pub fn add_notification(&mut self, notification: Notification)
Add a notification to the queue
Sourcepub fn add_warning(&mut self, msg: impl Into<String>)
pub fn add_warning(&mut self, msg: impl Into<String>)
Add a warning notification
Sourcepub fn add_success(&mut self, msg: impl Into<String>)
pub fn add_success(&mut self, msg: impl Into<String>)
Add a success notification
Sourcepub fn update_notifications(&mut self)
pub fn update_notifications(&mut self)
Remove expired notifications
Sourcepub fn next_baud_rate(&mut self) -> bool
pub fn next_baud_rate(&mut self) -> bool
Select next baud rate
Sourcepub fn prev_baud_rate(&mut self) -> bool
pub fn prev_baud_rate(&mut self) -> bool
Select previous baud rate
Sourcepub fn toggle_parity(&mut self) -> bool
pub fn toggle_parity(&mut self) -> bool
Toggle parity setting
Sourcepub fn toggle_flow_control(&mut self) -> bool
pub fn toggle_flow_control(&mut self) -> bool
Toggle flow control setting
Sourcepub fn next_data_bits(&mut self) -> bool
pub fn next_data_bits(&mut self) -> bool
Select next data bits setting
Sourcepub fn next_stop_bits(&mut self) -> bool
pub fn next_stop_bits(&mut self) -> bool
Select next stop bits setting
Sourcepub fn select_port(&mut self, index: usize) -> bool
pub fn select_port(&mut self, index: usize) -> bool
Select port (with validation)
Sourcepub fn toggle_tx_mode(&mut self)
pub fn toggle_tx_mode(&mut self)
Toggle transmission mode
Sourcepub fn next_append_mode(&mut self)
pub fn next_append_mode(&mut self)
Cycle to next append mode
Sourcepub fn prev_append_mode(&mut self)
pub fn prev_append_mode(&mut self)
Cycle to previous append mode
Sourcepub fn toggle_display_mode(&mut self)
pub fn toggle_display_mode(&mut self)
Toggle display mode
Sourcepub fn focus_next_field(&mut self)
pub fn focus_next_field(&mut self)
Focus next field
Sourcepub fn focus_prev_field(&mut self)
pub fn focus_prev_field(&mut self)
Focus previous field
Sourcepub fn save_config(&self) -> Result<(), String>
pub fn save_config(&self) -> Result<(), String>
Save configuration to file
Sourcepub fn load_config(&mut self)
pub fn load_config(&mut self)
Load configuration from file, return default if not found or error
Sourcepub fn toggle_language(&mut self)
pub fn toggle_language(&mut self)
Toggle language
Sourcepub fn toggle_shortcuts_help(&mut self)
pub fn toggle_shortcuts_help(&mut self)
Toggle shortcuts help overlay
Sourcepub fn show_shortcuts_help(&mut self)
pub fn show_shortcuts_help(&mut self)
Show shortcuts help
Sourcepub fn hide_shortcuts_help(&mut self)
pub fn hide_shortcuts_help(&mut self)
Hide shortcuts help
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnwindSafe for AppState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more