pub enum BackupError {
Show 15 variants
HomeDirectoryNotFound,
TargetNotFound {
path: PathBuf,
},
PermissionDenied {
path: PathBuf,
},
PathTraversalDetected {
path: PathBuf,
},
ParentDirectoryNotFound {
path: PathBuf,
},
ConfigLoadError(Error),
ConfigParseError {
message: String,
},
ConfigValidationError {
message: String,
},
IoError(Error),
RegexError {
pattern: String,
source: Error,
},
FileCopyError {
from: PathBuf,
to: PathBuf,
},
BackupDirectoryCreationError {
path: PathBuf,
},
EncryptionError(String),
CompressionError(String),
Other(Error),
}Expand description
backup-suite用のカスタムエラー型
すべてのバックアップ操作で発生する可能性のあるエラーを型安全に表現します。 thiserrorを使用して、エラーメッセージの生成とエラー変換を自動化しています。
Variants§
HomeDirectoryNotFound
ホームディレクトリが見つからない場合
TargetNotFound
バックアップ対象が存在しない場合
PermissionDenied
読み取り権限がない場合
PathTraversalDetected
ディレクトリトラバーサル攻撃を検出した場合
ParentDirectoryNotFound
親ディレクトリが見つからない場合
ConfigLoadError(Error)
設定ファイルの読み込みエラー
ConfigParseError
設定ファイルのパースエラー
ConfigValidationError
設定の検証エラー
IoError(Error)
I/Oエラー
RegexError
正規表現のコンパイルエラー
FileCopyError
ファイルコピーエラー
BackupDirectoryCreationError
バックアップディレクトリ作成エラー
EncryptionError(String)
暗号化・復号化エラー
CompressionError(String)
圧縮・展開エラー
Other(Error)
その他のエラー(anyhowからの変換用)
Implementations§
Source§impl BackupError
impl BackupError
Trait Implementations§
Source§impl Debug for BackupError
impl Debug for BackupError
Source§impl Display for BackupError
impl Display for BackupError
Source§impl Error for BackupError
impl Error for BackupError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<BackupError> for SmartError
impl From<BackupError> for SmartError
Source§fn from(err: BackupError) -> Self
fn from(err: BackupError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for BackupError
impl From<Error> for BackupError
Source§impl From<Error> for BackupError
impl From<Error> for BackupError
Auto Trait Implementations§
impl Freeze for BackupError
impl !RefUnwindSafe for BackupError
impl Send for BackupError
impl Sync for BackupError
impl Unpin for BackupError
impl !UnwindSafe for BackupError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.