pub struct ModemControlDialog { /* private fields */ }Expand description
Immediate-action dialog for toggling DTR / RTS and sending a line break.
Stores a read-only ModemLineSnapshot for the header display and
an integer cursor covering six action rows. Emits
DialogAction::SetDtr / DialogAction::SetRts /
DialogAction::SendBreak on Enter over an action row; emits
DialogOutcome::Close on Esc or Enter over [Close].
Implementations§
Source§impl ModemControlDialog
impl ModemControlDialog
Sourcepub const fn new(current: ModemLineSnapshot) -> Self
pub const fn new(current: ModemLineSnapshot) -> Self
Construct a dialog displaying current as the read-only
“current output lines” snapshot, cursor on the first action
(Raise DTR).
Sourcepub const fn cursor(&self) -> usize
pub const fn cursor(&self) -> usize
Current cursor position. Valid range is 0..6: 0..=4 select
an action row, 5 selects the [Close] button.
Sourcepub const fn current_lines(&self) -> &ModemLineSnapshot
pub const fn current_lines(&self) -> &ModemLineSnapshot
Read-only snapshot of the modem output lines as known to rtcom at the time this dialog was constructed.
Trait Implementations§
Source§impl Dialog for ModemControlDialog
impl Dialog for ModemControlDialog
Source§fn preferred_size(&self, outer: Rect) -> Rect
fn preferred_size(&self, outer: Rect) -> Rect
Preferred size of the dialog when rendered inside
outer. Read moreSource§fn handle_key(&mut self, key: KeyEvent) -> DialogOutcome
fn handle_key(&mut self, key: KeyEvent) -> DialogOutcome
Handle a key event and report back how the stack should react.
Auto Trait Implementations§
impl Freeze for ModemControlDialog
impl RefUnwindSafe for ModemControlDialog
impl Send for ModemControlDialog
impl Sync for ModemControlDialog
impl Unpin for ModemControlDialog
impl UnsafeUnpin for ModemControlDialog
impl UnwindSafe for ModemControlDialog
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
Mutably borrows from an owned value. Read more
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>
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 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>
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