pub struct RootMenu { /* private fields */ }Expand description
Top-level configuration menu (the first real Dialog impl).
Owns a fixed list of seven entries, an integer cursor, a snapshot
of the current SerialConfig / LineEndingConfig (passed on
to sub-dialogs), and a rendering style. Emits
DialogOutcome::Push for every non-exit selection and
DialogOutcome::Close for Esc / “Exit menu”.
Implementations§
Source§impl RootMenu
impl RootMenu
Sourcepub const fn new(
initial_config: SerialConfig,
initial_line_endings: LineEndingConfig,
initial_modem: ModemLineSnapshot,
initial_modal_style: ModalStyle,
cli_overrides: Vec<&'static str>,
) -> Self
pub const fn new( initial_config: SerialConfig, initial_line_endings: LineEndingConfig, initial_modem: ModemLineSnapshot, initial_modal_style: ModalStyle, cli_overrides: Vec<&'static str>, ) -> Self
Construct a root menu with the cursor on the first item and
snapshotting initial_config, initial_line_endings,
initial_modem, initial_modal_style, and cli_overrides for
forwarding to sub-dialogs (SerialPortSetupDialog,
LineEndingsDialog, ModemControlDialog, and
ScreenOptionsDialog).
cli_overrides carries short flag labels (-b, -d, …)
for every CLI argument that overrode a profile value at
startup. Pass Vec::new() when no flags override anything;
the SerialPortSetupDialog skips its hint line in that case.
Trait Implementations§
Source§impl Dialog for RootMenu
impl Dialog for RootMenu
Source§fn handle_key(&mut self, key: KeyEvent) -> DialogOutcome
fn handle_key(&mut self, key: KeyEvent) -> DialogOutcome
Auto Trait Implementations§
impl Freeze for RootMenu
impl RefUnwindSafe for RootMenu
impl Send for RootMenu
impl Sync for RootMenu
impl Unpin for RootMenu
impl UnsafeUnpin for RootMenu
impl UnwindSafe for RootMenu
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