Skip to main content

Home

Struct Home 

Source
pub struct Home {
Show 19 fields pub scope: Scope, pub limit_units: Vec<String>, pub theme: Theme, pub logger: Logger, pub show_logger: bool, pub all_units: IndexMap<UnitId, UnitWithStatus>, pub filtered_units: StatefulList<MatchedUnit>, pub logs: Vec<String>, pub logs_scroll_offset: u16, pub mode: Mode, pub previous_mode: Option<Mode>, pub input: Input, pub menu_items: StatefulList<MenuItem>, pub cancel_token: Option<CancellationToken>, pub spinner_tick: u8, pub error_message: String, pub action_tx: Option<UnboundedSender<Action>>, pub journalctl_tx: Option<Sender<UnitId>>, pub fuzzy_matcher: SkimMatcherV2,
}

Fields§

§scope: Scope§limit_units: Vec<String>§theme: Theme§logger: Logger§show_logger: bool§all_units: IndexMap<UnitId, UnitWithStatus>§filtered_units: StatefulList<MatchedUnit>§logs: Vec<String>§logs_scroll_offset: u16§mode: Mode§previous_mode: Option<Mode>§input: Input§menu_items: StatefulList<MenuItem>§cancel_token: Option<CancellationToken>§spinner_tick: u8§error_message: String§action_tx: Option<UnboundedSender<Action>>§journalctl_tx: Option<Sender<UnitId>>§fuzzy_matcher: SkimMatcherV2

Implementations§

Source§

impl Home

Source

pub fn new(scope: Scope, limit_units: &[String]) -> Self

Source

pub fn set_units(&mut self, units: Vec<UnitWithStatus>)

Source

pub fn sort_units(&mut self)

Source

pub fn merge_unit_files(&mut self, unit_files: Vec<UnitFile>)

Merge unit file info (enablement state, file path) into existing units. Also adds units that aren’t returned by ListUnits (e.g. disabled, static, masked).

Source

pub fn update_units(&mut self, units: Vec<UnitWithStatus>)

Source

pub fn next(&mut self)

Source

pub fn previous(&mut self)

Source

pub fn select(&mut self, index: Option<usize>, refresh_logs: bool)

Source

pub fn unselect(&mut self)

Source

pub fn selected_service(&self) -> Option<UnitId>

Source

pub fn get_logs(&mut self)

Source

pub fn refresh_filtered_units(&mut self)

Trait Implementations§

Source§

impl Component for Home

Source§

fn init(&mut self, tx: UnboundedSender<Action>) -> Result<()>

Source§

fn handle_key_events(&mut self, key: KeyEvent) -> Vec<Action>

Source§

fn dispatch(&mut self, action: Action) -> Option<Action>

Source§

fn render(&mut self, f: &mut Frame<'_>, rect: Rect)

Source§

fn handle_events(&mut self, event: Option<Event>) -> Vec<Action>

Source§

fn handle_mouse_events(&mut self, mouse: MouseEvent) -> Vec<Action>

Source§

impl Default for Home

Source§

fn default() -> Home

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for Home

§

impl !RefUnwindSafe for Home

§

impl Send for Home

§

impl Sync for Home

§

impl Unpin for Home

§

impl !UnwindSafe for Home

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> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
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