Skip to main content

App

Struct App 

Source
pub struct App {
Show 14 fields pub should_quit: bool, pub repo_info: Option<RepoInfo>, pub selected_index: usize, pub show_detail: bool, pub input_mode: InputMode, pub filter_text: String, pub branches: Vec<String>, pub branch_selected_index: usize, pub file_statuses: Vec<FileStatus>, pub status_selected_index: usize, pub commit_message: String, pub status_message: Option<String>, pub is_loading: bool, pub show_help: bool, /* private fields */
}
Expand description

アプリケーション状態

Fields§

§should_quit: bool

アプリケーションが終了すべきかどうか

§repo_info: Option<RepoInfo>

リポジトリ情報

§selected_index: usize

選択中のイベントインデックス(filtered_indices内)

§show_detail: bool

詳細表示モード

§input_mode: InputMode

入力モード

§filter_text: String

フィルタ文字列

§branches: Vec<String>

ブランチ一覧

§branch_selected_index: usize

ブランチ選択インデックス

§file_statuses: Vec<FileStatus>

ファイルステータス一覧

§status_selected_index: usize

ステータス選択インデックス

§commit_message: String

コミットメッセージ

§status_message: Option<String>

ステータスメッセージ(操作結果表示用)

§is_loading: bool

バックグラウンド読み込み中フラグ

§show_help: bool

ヘルプ表示フラグ

Implementations§

Source§

impl App

Source

pub fn new() -> Self

Source

pub fn load(&mut self, repo_info: RepoInfo, events: Vec<GitEvent>)

リポジトリ情報とイベントを設定

Source

pub fn events(&self) -> Vec<&GitEvent>

フィルタ後のイベント一覧を取得

Source

pub fn event_count(&self) -> usize

フィルタ後のイベント数を取得

Source

pub fn quit(&mut self)

qキーで終了

Source

pub fn move_up(&mut self)

選択を上に移動

Source

pub fn move_down(&mut self)

選択を下に移動

Source

pub fn move_to_top(&mut self)

先頭に移動 (gg)

Source

pub fn move_to_bottom(&mut self)

末尾に移動 (G)

Source

pub fn page_down(&mut self, page_size: usize)

ページダウン (Ctrl+d)

Source

pub fn page_up(&mut self, page_size: usize)

ページアップ (Ctrl+u)

Source

pub fn toggle_help(&mut self)

ヘルプ表示を切り替え

Source

pub fn close_help(&mut self)

ヘルプを閉じる

Source

pub fn selected_event(&self) -> Option<&GitEvent>

選択中のイベントを取得

Source

pub fn open_detail(&mut self)

詳細表示を開く

Source

pub fn close_detail(&mut self)

詳細表示を閉じる

Source

pub fn start_filter(&mut self)

フィルタモードを開始

Source

pub fn end_filter(&mut self)

フィルタモードを終了

Source

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

フィルタ文字を追加

Source

pub fn filter_pop(&mut self)

フィルタ文字を削除

Source

pub fn filter_clear(&mut self)

フィルタをクリア

Source

pub fn repo_name(&self) -> &str

リポジトリ名を取得

Source

pub fn branch_name(&self) -> &str

ブランチ名を取得

Source

pub fn start_branch_select(&mut self, branches: Vec<String>)

ブランチ選択モードを開始

Source

pub fn end_branch_select(&mut self)

ブランチ選択モードを終了

Source

pub fn branch_move_up(&mut self)

ブランチ選択を上に移動

Source

pub fn branch_move_down(&mut self)

ブランチ選択を下に移動

Source

pub fn selected_branch(&self) -> Option<&str>

選択中のブランチ名を取得

Source

pub fn update_branch(&mut self, branch: String)

ブランチ切り替え後にリポジトリ情報を更新

Source

pub fn all_events_replace(&mut self, events: Vec<GitEvent>)

イベント一覧を置き換え

Source

pub fn filtered_indices_reset(&mut self, count: usize)

フィルタインデックスをリセット

Source

pub fn start_status_view(&mut self, statuses: Vec<FileStatus>)

ステータスビューモードを開始

Source

pub fn end_status_view(&mut self)

ステータスビューモードを終了

Source

pub fn status_move_up(&mut self)

ステータス選択を上に移動

Source

pub fn status_move_down(&mut self)

ステータス選択を下に移動

Source

pub fn selected_file_status(&self) -> Option<&FileStatus>

選択中のファイルステータスを取得

Source

pub fn update_file_statuses(&mut self, statuses: Vec<FileStatus>)

ファイルステータス一覧を更新

Source

pub fn set_status_message(&mut self, msg: String)

ステータスメッセージを設定

Source

pub fn start_commit_input(&mut self)

コミット入力モードを開始

Source

pub fn end_commit_input(&mut self)

コミット入力モードを終了

Source

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

コミットメッセージに文字を追加

Source

pub fn commit_message_pop(&mut self)

コミットメッセージから文字を削除

Source

pub fn commit_message_clear(&mut self)

コミットメッセージをクリア

Source

pub fn file_status_count(&self) -> usize

ファイルステータス数を取得

Source

pub fn start_loading(&mut self)

読み込み中状態を開始

Source

pub fn finish_loading(&mut self)

読み込み中状態を終了

Source

pub fn append_events(&mut self, events: Vec<GitEvent>)

イベントを追加(バックグラウンド読み込み用)

Trait Implementations§

Source§

impl Default for App

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnwindSafe for App

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, 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.