BackupProgress

Struct BackupProgress 

Source
pub struct BackupProgress { /* private fields */ }
Expand description

バックアップ進捗表示機能

indicatifライブラリを使用してリアルタイムの進捗状況を表示します。

§機能

  • メインプログレスバー: 全体の進捗を表示
  • 詳細プログレスバー: 現在処理中のファイル情報を表示
  • 経過時間と推定残り時間(ETA)を表示
  • 処理速度表示(ファイル/秒、MB/秒)

§使用例

use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new(100);
progress.set_message("処理中: /path/to/file.txt");
progress.inc(1);
progress.finish("バックアップ完了");

Implementations§

Source§

impl BackupProgress

Source

pub fn new(total_files: u64) -> Self

新しいBackupProgressインスタンスを作成

§引数
  • total_files - バックアップ対象の総ファイル数
§戻り値

BackupProgressインスタンス

§使用例
use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new(100);
Source

pub fn with_language(total_files: u64, lang: Language) -> Self

言語指定付きでBackupProgressインスタンスを作成

Source

pub fn inc(&self, delta: u64)

プログレスバーを指定量進める

§引数
  • delta - 進める量(通常は1)
§使用例
use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new(100);
progress.inc(1); // 1つ進める
Source

pub fn set_message(&self, msg: &str)

詳細メッセージを設定

現在処理中のファイルや操作の詳細を表示します。

§引数
  • msg - 表示するメッセージ
§使用例
use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new(100);
progress.set_message("処理中: /path/to/file.txt");
Source

pub fn set_main_message(&self, msg: &str)

メインプログレスバーのメッセージを設定

§引数
  • msg - 表示するメッセージ
§使用例
use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new(100);
progress.set_main_message("高優先度ファイル処理中");
Source

pub fn set_stats(&self, msg: &str)

統計メッセージを設定

処理速度やデータ量などの統計情報を表示します。

§引数
  • msg - 表示するメッセージ
§使用例
use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new(100);
progress.set_stats("速度: 15.2 MB/s | 合計: 1.5 GB");
Source

pub fn finish(&self, msg: &str)

プログレスバーを完了させる

最終メッセージを表示してプログレスバーを終了します。

§引数
  • msg - 完了メッセージ
§使用例
use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new(100);
// ... 処理 ...
progress.finish("バックアップ完了!");
Source

pub fn set_position(&self, pos: u64)

現在の位置を設定

§引数
  • pos - 新しい位置
§使用例
use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new(100);
progress.set_position(50); // 50%に設定
Source

pub fn set_length(&self, len: u64)

総数を設定

処理中に総ファイル数が判明した場合に使用します。

§引数
  • len - 新しい総数
§使用例
use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new(0);
progress.set_length(150); // 実際の総数が判明
Source

pub fn finish_and_clear(&self)

プログレスバーを非表示にして完了

メッセージを表示せずに終了します。

§使用例
use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new(100);
progress.finish_and_clear();
Source

pub fn new_spinner() -> Self

スピナーモードのプログレスバーを作成

ファイル数が不明な場合に使用するスピナー表示。

§戻り値

スピナーモードのBackupProgress

§使用例
use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new_spinner();
progress.set_message("ファイル検索中...");
// ... 処理 ...
progress.finish("検索完了");
Source

pub fn new_spinner_with_language(lang: Language) -> Self

言語指定付きでスピナーを作成

Source

pub fn update_stats( &self, processed_files: u64, total_bytes: u64, elapsed_secs: f64, )

処理速度を計算して統計情報を更新

§引数
  • processed_files - 処理済みファイル数
  • total_bytes - 処理済みバイト数
  • elapsed_secs - 経過秒数
§使用例
use backup_suite::ui::progress::BackupProgress;

let progress = BackupProgress::new(100);
progress.update_stats(50, 52_428_800, 10.5); // 50ファイル, 50MB, 10.5秒

Trait Implementations§

Source§

impl Clone for BackupProgress

Source§

fn clone(&self) -> BackupProgress

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V