Skip to main content

SerialPortSetupDialog

Struct SerialPortSetupDialog 

Source
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

Source

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.

Source

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).

Source

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).

Source

pub const fn is_editing(&self) -> bool

True while the user is typing into a numeric field.

Source

pub const fn pending(&self) -> &SerialConfig

The currently pending SerialConfig; reflects every committed edit since construction.

Trait Implementations§

Source§

impl Dialog for SerialPortSetupDialog

Source§

fn title(&self) -> &str

Human-readable title, used for decoration.
Source§

fn preferred_size(&self, outer: Rect) -> Rect

Preferred size of the dialog when rendered inside outer. Read more
Source§

fn render(&self, area: Rect, buf: &mut Buffer)

Render the dialog into the given area.
Source§

fn handle_key(&mut self, key: KeyEvent) -> DialogOutcome

Handle a key event and report back how the stack should react.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more