pub enum PkgError {
NetworkError(String),
IoError(String),
DatabaseError(String),
ParseError(String),
PackageNotFound(String),
RepoError(String),
CompressionError(String),
XmlError(String),
InvalidArgument(String),
}Expand description
pkq 统一错误枚举。
Display 实现由 thiserror 生成,直接面向用户输出;
常见外部错误(io/rusqlite/quick-xml/serde_json)已提供 From 转换。
Variants§
NetworkError(String)
网络请求失败(超时、状态码异常等)。
IoError(String)
文件系统 IO 失败。
DatabaseError(String)
本地数据库(rpmdb sqlite)访问失败。
ParseError(String)
数据解析失败(索引文件格式异常)。
PackageNotFound(String)
目标软件包未找到。
RepoError(String)
仓库配置或元数据异常。
CompressionError(String)
解压缩失败(gz/lz4 等)。
XmlError(String)
XML 解析失败(repodata)。
InvalidArgument(String)
非法参数(用户输入或内部约定违背)。
Trait Implementations§
Source§impl Error for PkgError
impl Error for PkgError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for PkgError
impl RefUnwindSafe for PkgError
impl Send for PkgError
impl Sync for PkgError
impl Unpin for PkgError
impl UnsafeUnpin for PkgError
impl UnwindSafe for PkgError
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 more