pub struct SerialPortSetupDialog { /* private fields */ }Expand description
Serial port setup dialog.
Holds a snapshot of the initial SerialConfig and a mutable
pending copy that tracks the user’s edits. Emits
DialogAction::ApplyLive on F2 / Enter on [Apply live],
DialogAction::ApplyAndSave on F10 / Enter on
[Apply + Save], and DialogOutcome::Close on Esc / Enter
on [Cancel].
After emitting an Action, the dialog stays open — T17 wires the
outer TuiApp to pop the stack once the action has been applied.
Implementations§
Source§impl SerialPortSetupDialog
impl SerialPortSetupDialog
Sourcepub const fn new(
initial_config: SerialConfig,
cli_overrides: Vec<&'static str>,
) -> Self
pub const fn new( initial_config: SerialConfig, cli_overrides: Vec<&'static str>, ) -> Self
Construct a dialog seeded with initial_config. The cursor
starts on the baud-rate row in field-navigation (idle) mode.
cli_overrides carries flag labels for CLI args that
overrode a profile value at startup; when non-empty a hint
line renders below the action buttons.
Sourcepub const fn has_cli_override_hint(&self) -> bool
pub const fn has_cli_override_hint(&self) -> bool
Whether the dialog will render a CLI-override hint line at the
bottom (i.e. its cli_overrides list is non-empty).
Sourcepub const fn cursor(&self) -> usize
pub const fn cursor(&self) -> usize
Current cursor position. Valid range is 0..8: indices 0..=4
select a field (baud / data bits / stop bits / parity / flow
control), and 5..=7 select one of the action buttons
(Apply live / Apply + Save / Cancel).
Sourcepub const fn is_editing(&self) -> bool
pub const fn is_editing(&self) -> bool
True while the user is typing into a numeric field.
Sourcepub const fn pending(&self) -> &SerialConfig
pub const fn pending(&self) -> &SerialConfig
The currently pending SerialConfig; reflects every committed
edit since construction.
Trait Implementations§
Source§impl Dialog for SerialPortSetupDialog
impl Dialog for SerialPortSetupDialog
Source§fn preferred_size(&self, outer: Rect) -> Rect
fn preferred_size(&self, outer: Rect) -> Rect
outer. Read moreSource§fn handle_key(&mut self, key: KeyEvent) -> DialogOutcome
fn handle_key(&mut self, key: KeyEvent) -> DialogOutcome
Auto Trait Implementations§
impl Freeze for SerialPortSetupDialog
impl RefUnwindSafe for SerialPortSetupDialog
impl Send for SerialPortSetupDialog
impl Sync for SerialPortSetupDialog
impl Unpin for SerialPortSetupDialog
impl UnsafeUnpin for SerialPortSetupDialog
impl UnwindSafe for SerialPortSetupDialog
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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