pub struct App {Show 20 fields
backend: Box<dyn Backend>,
pub listing: Option<Listing>,
pub listing_error: Option<String>,
pub kernel: Option<KernelState>,
read_kernel: Box<dyn Fn() -> Option<KernelState>>,
kernel_disputed: bool,
watcher: Option<Watcher>,
pub selected: usize,
pub sched_selected: usize,
pub args: Option<Input>,
pub all_warned: bool,
pub message: Option<Message>,
last_action: Option<Instant>,
pub view: View,
pub log_previous_boot: bool,
pub log_lines: Vec<LogLine>,
pub log_scroll: usize,
pub log_page: usize,
pending_action: Option<PendingAction>,
should_quit: bool,
}Fields§
§backend: Box<dyn Backend>§listing: Option<Listing>Last successful listing. Stays None after a failed read, with
the failure in listing_error, so the panel shows “unknown” plus
the reason instead of a stale snapshot.
listing_error: Option<String>§kernel: Option<KernelState>The kernel’s own view, re-read every tick.
read_kernel: Box<dyn Fn() -> Option<KernelState>>§kernel_disputed: bool§watcher: Option<Watcher>§selected: usize§sched_selected: usize§args: Option<Input>The options field of the full list, when open. While it is open it owns every key press, so global shortcuts cannot fire from typed text.
all_warned: boolThe full list’s warning is shown once per session.
message: Option<Message>§last_action: Option<Instant>§view: View§log_previous_boot: bool§log_lines: Vec<LogLine>§log_scroll: usize§log_page: usize§pending_action: Option<PendingAction>§should_quit: boolImplementations§
Source§impl App
impl App
pub fn new(backend: Box<dyn Backend>) -> Self
pub fn backend_label(&self) -> String
pub fn recommended(&self) -> &[Pick]
pub fn all(&self) -> &[Installed]
pub fn selected_pick(&self) -> Option<&Pick>
pub fn selected_scheduler(&self) -> Option<&Installed>
pub fn run(&mut self, terminal: DefaultTerminal) -> Result<()>
fn start_watching(&mut self)
Sourcefn run_monitor(&mut self, terminal: &mut DefaultTerminal) -> Result<()>
fn run_monitor(&mut self, terminal: &mut DefaultTerminal) -> Result<()>
Hands the terminal over to scxtop and takes it back afterwards.
fn queue(&mut self, action: PendingAction)
Sourcefn privileged(
&mut self,
terminal: &mut DefaultTerminal,
call: impl FnOnce(&dyn Backend) -> Result<String>,
) -> Result<Result<String>>
fn privileged( &mut self, terminal: &mut DefaultTerminal, call: impl FnOnce(&dyn Backend) -> Result<String>, ) -> Result<Result<String>>
Runs a privileged scxcli command. When it goes through pkexec the terminal is handed over for the duration, because pkexec may prompt for a password on it (a text agent when the session has no graphical one); with the shipped policy starting a scheduler from the list prompts for nothing and the hand-over is a flicker.
fn run_action( &mut self, action: PendingAction, terminal: &mut DefaultTerminal, ) -> Result<()>
fn on_key(&mut self, key: KeyEvent)
fn on_key_args(&mut self, key: KeyEvent)
fn submit_args(&mut self)
fn on_key_recommended(&mut self, key: KeyEvent)
fn on_key_all(&mut self, key: KeyEvent)
fn on_key_logs(&mut self, key: KeyEvent)
fn open_all(&mut self)
fn open_logs(&mut self)
fn reload_logs(&mut self)
Sourcefn sync_selection_to_running(&mut self)
fn sync_selection_to_running(&mut self)
Aligns the selections with what runs, so the first Enter acts on what the user sees. Only on startup, never on a refresh, which must not fight the user’s own selection.
fn action_allowed(&mut self) -> bool
Sourcefn start_selected_pick(&mut self)
fn start_selected_pick(&mut self)
Enter in the recommended list: scxcli start ID. The same call
whether the entry is stopped, failed or running something else;
scxcli rewrites the file and restarts the unit either way.
Sourcefn stop_running(&mut self)
fn stop_running(&mut self)
s: stop the unit and keep the selection, so it comes back on
the next start or boot. Not start default, which forgets it.
Sourcepub fn kernel_warning(&self) -> Option<String>
pub fn kernel_warning(&self) -> Option<String>
The panel’s warning; the event loop reuses it as a tripwire.
Sourcefn reconcile_kernel_dispute(&mut self) -> bool
fn reconcile_kernel_dispute(&mut self) -> bool
Edge-triggered: re-asks once per new dispute.
Sourcepub fn warn(&mut self, text: &str)
pub fn warn(&mut self, text: &str)
An error-styled message that stays until replaced, for a condition found before the loop starts.
fn info(&mut self, text: &str)
fn error(&mut self, text: &str)
Auto Trait Implementations§
impl !RefUnwindSafe for App
impl !Send for App
impl !Sync for App
impl !UnwindSafe for App
impl Freeze for App
impl Unpin for App
impl UnsafeUnpin for App
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