Skip to main content

App

Struct App 

Source
pub struct App {
Show 25 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 filter_query: FilterQuery, pub branches: Vec<String>, pub branch_selected_index: usize, pub file_statuses: Vec<FileStatus>, pub status_selected_index: usize, pub commit_message: String, pub commit_type: Option<CommitType>, pub status_message: Option<String>, pub is_loading: bool, pub show_help: bool, pub view_mode: ViewMode, pub topology_cache: Option<BranchTopology>, pub topology_selected_index: usize, pub topology_scroll_offset: usize, pub commit_suggestions: Vec<CommitSuggestion>, pub suggestion_selected_index: usize, pub detail_scroll_offset: usize, pub detail_selected_file: usize, pub detail_diff_cache: Option<CommitDiff>, /* 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

フィルタ文字列

§filter_query: FilterQuery

パース済みフィルタクエリ

§branches: Vec<String>

ブランチ一覧

§branch_selected_index: usize

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

§file_statuses: Vec<FileStatus>

ファイルステータス一覧

§status_selected_index: usize

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

§commit_message: String

コミットメッセージ

§commit_type: Option<CommitType>

選択されたコミットタイプ

§status_message: Option<String>

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

§is_loading: bool

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

§show_help: bool

ヘルプ表示フラグ

§view_mode: ViewMode

表示モード(Normal/Compact/Grid)

§topology_cache: Option<BranchTopology>

トポロジーキャッシュ

§topology_selected_index: usize

トポロジービューの選択インデックス

§topology_scroll_offset: usize

トポロジービューのスクロールオフセット

§commit_suggestions: Vec<CommitSuggestion>

コミット提案一覧

§suggestion_selected_index: usize

提案選択インデックス

§detail_scroll_offset: usize

詳細ビューのスクロールオフセット

§detail_selected_file: usize

詳細ビューで選択中のファイルインデックス

§detail_diff_cache: Option<CommitDiff>

詳細ビューのdiffキャッシュ

Implementations§

Source§

impl App

Source

pub fn new() -> Self

Source

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

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

Source

pub fn set_repo(&mut self, repo: Repository)

キャッシュ用リポジトリを設定

Source

pub fn get_repo(&self) -> Option<&Repository>

キャッシュ済みリポジトリの参照を取得

Source

pub fn set_head_hash(&mut self, hash: String)

HEADハッシュを設定(@キージャンプ用)

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 jump_to_head(&mut self)

HEADにジャンプ (@キー) フィルタ中でもHEADの位置に移動

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 cycle_view_mode(&mut self)

表示モードをサイクル切り替え(Normal → Compact → Grid → Normal)

Source

pub fn jump_to_next_label(&mut self)

次のラベル付きコミットにジャンプ (] キー)

Source

pub fn jump_to_prev_label(&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 set_detail_diff(&mut self, diff: CommitDiff)

詳細ビューでdiffをキャッシュ

Source

pub fn detail_move_up(&mut self)

詳細ビューでファイル選択を上に移動

Source

pub fn detail_move_down(&mut self)

詳細ビューでファイル選択を下に移動

Source

pub fn detail_adjust_scroll(&mut self, visible_lines: usize)

詳細ビューのスクロール調整(表示可能行数を考慮)

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 preload_file_cache( &mut self, get_files: impl Fn(&str) -> Option<Vec<String>>, )

ファイルキャッシュをプリロード(ファイルフィルタ有効時) 注意: UIブロッキングを防ぐため、最新N件のみキャッシュする

Source

pub fn clear_file_cache(&mut self)

ファイルキャッシュをクリア

Source

pub fn file_cache_is_empty(&self) -> bool

ファイルキャッシュが空かどうか

Source

pub fn reapply_filter(&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 select_commit_type(&mut self, commit_type: CommitType)

コミットタイプを選択

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>)

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

Source

pub fn start_topology_view(&mut self, topology: BranchTopology)

トポロジービューを開始

Source

pub fn end_topology_view(&mut self)

トポロジービューを終了

Source

pub fn topology_move_up(&mut self)

トポロジー選択を上に移動

Source

pub fn topology_move_down(&mut self)

トポロジー選択を下に移動

Source

pub fn topology_adjust_scroll(&mut self, visible_lines: usize)

トポロジービューの表示可能行数を設定してスクロールを調整

Source

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

選択中のトポロジーブランチ名を取得

Source

pub fn filter_description(&self) -> String

フィルタクエリの説明を取得

Source

pub fn generate_commit_suggestions(&mut self)

コミット提案を生成

Source

pub fn apply_suggestion(&mut self, index: usize)

提案を適用

Source

pub fn suggestion_move_up(&mut self)

提案選択を上に移動

Source

pub fn suggestion_move_down(&mut self)

提案選択を下に移動

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.