Skip to main content

TuiApp

Struct TuiApp 

Source
pub struct TuiApp {
Show 13 fields pub query: String, pub records: Vec<CommandRecord>, pub filtered: Vec<usize>, pub selected: usize, pub filters: TuiFilters, pub mode: TuiMode, pub status_message: Option<String>, pub outcome: Option<String>, pub should_quit: bool, pub copy_buffer: Option<String>, pub page_size: usize, pub current_project: Option<String>, pub current_branch: Option<String>, /* private fields */
}
Expand description

État complet de la TUI.

Fields§

§query: String

Requête de recherche courante.

§records: Vec<CommandRecord>

Toutes les commandes chargées en mémoire.

§filtered: Vec<usize>

Indices (dans records) retenus après filtres + recherche.

§selected: usize

Position sélectionnée dans filtered.

§filters: TuiFilters

Filtres interactifs actifs.

§mode: TuiMode

Mode courant.

§status_message: Option<String>

Message de statut transitoire affiché en pied de page.

§outcome: Option<String>

Commande retenue par l’utilisateur (imprimée à la sortie).

§should_quit: bool

Demande de sortie de la boucle d’événements.

§copy_buffer: Option<String>

Dernière commande mise dans le tampon interne (raccourci c).

§page_size: usize

Taille de page courante (mise à jour au rendu).

§current_project: Option<String>

Projet du dossier de lancement (pour le filtre p).

§current_branch: Option<String>

Branche du dossier de lancement (pour le filtre b).

Implementations§

Source§

impl TuiApp

Source

pub fn new( records: Vec<CommandRecord>, filters: TuiFilters, query: String, ) -> Self

Construit l’application à partir des commandes chargées, de filtres initiaux et d’une requête initiale.

Source

pub fn set_current_context( &mut self, project: Option<String>, branch: Option<String>, )

Renseigne le projet et la branche du dossier de lancement, utilisés par les raccourcis « filtre projet/branche courant(e) » (p / b).

Source

pub fn recompute(&mut self)

Recalcule la liste filtrée (filtres structurés puis recherche fuzzy) et borne la sélection pour qu’elle reste valide.

Source

pub fn select_next(&mut self)

Source

pub fn select_previous(&mut self)

Source

pub fn page_down(&mut self)

Source

pub fn page_up(&mut self)

Source

pub fn select_first(&mut self)

Source

pub fn select_last(&mut self)

Source

pub fn selected_record(&self) -> Option<&CommandRecord>

Référence vers la commande sélectionnée, le cas échéant.

Source

pub fn selected_id(&self) -> Option<i64>

Identifiant de la commande sélectionnée.

Source

pub fn overview(&self) -> Overview

Calcule les indicateurs (KPI) affichés dans la barre de synthèse : total chargé, visibles après filtres, succès / échecs visibles, taux d’échec, nombre de projets distincts et shell dominant.

Source

pub fn push_query_char(&mut self, c: char)

Source

pub fn pop_query_char(&mut self)

Source

pub fn toggle_help(&mut self)

Source

pub fn toggle_filters(&mut self)

Source

pub fn toggle_details_focus(&mut self)

Source

pub fn filter_project_from_selection(&mut self)

Source

pub fn filter_branch_from_selection(&mut self)

Source

pub fn filter_cwd_from_selection(&mut self)

Source

pub fn cycle_status_filter(&mut self)

Source

pub fn clear_filters(&mut self)

Source

pub fn filter_project_current(&mut self)

Filtre par le projet du dossier de lancement (raccourci p).

Source

pub fn filter_branch_current(&mut self)

Filtre par la branche du dossier de lancement (raccourci b).

Donne le focus à la recherche (raccourci /).

Source

pub fn export_results(&mut self)

Exporte les résultats filtrés vers un fichier JSON (raccourci e).

Le fichier est créé dans le répertoire courant sous un nom horodaté. En cas d’erreur, l’export est signalé dans le pied de page sans interrompre la TUI.

Source

pub fn request_delete(&mut self)

Passe en mode confirmation si une commande est sélectionnée.

Source

pub fn cancel_delete(&mut self)

Annule la confirmation de suppression.

Source

pub fn confirm_delete<B: TuiBackend>(&mut self, backend: &mut B)

Confirme la suppression : crée un backup puis supprime via le backend. En cas d’échec du backend (ex. backup impossible), rien n’est retiré.

Source

pub fn copy_selection(&mut self)

Met la commande sélectionnée dans le tampon interne et tente une copie vers le presse-papiers système (sans dépendance obligatoire).

Source

pub fn refresh<B: TuiBackend>(&mut self, backend: &mut B)

Recharge les commandes depuis le backend (raccourci r).

Source

pub fn select_and_quit(&mut self)

Valide la sélection : retient la commande et demande la sortie.

Source

pub fn dispatch<B: TuiBackend>(&mut self, action: Action, backend: &mut B)

Applique une action issue du clavier.

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, 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> Same for T

Source§

type Output = T

Should always be Self
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.