Skip to main content

DockerErrorKind

Enum DockerErrorKind 

Source
pub enum DockerErrorKind {
Show 41 variants InvalidFormat { field: String, expected: String, }, OutOfRange { field: String, min: Option<String>, max: Option<String>, }, Required { field: String, }, AlreadyExists { field: String, value: String, }, NotAllowed { field: String, allowed: Vec<String>, }, InvalidParams { param: String, reason: String, }, InvalidCredentials, AccountLocked, UserNotFound { identifier: String, }, UserAlreadyExists { username: String, }, InvalidToken { reason: String, }, TokenExpired, PermissionDenied { action: String, }, Forbidden { resource: String, }, ResourceNotFound { resource_type: String, identifier: String, }, ResourceConflict { resource: String, reason: String, }, RateLimited { limit: u64, }, ConnectionFailed { target: String, }, DnsResolutionFailed { host: String, }, ServiceUnavailable { service: String, }, StorageReadFailed { path: String, }, StorageWriteFailed { path: String, }, StorageDeleteFailed { path: String, }, InsufficientCapacity { required: u64, available: u64, }, StorageFileNotFound { path: String, }, ConfigMissing { key: String, }, ConfigInvalid { key: String, reason: String, }, InternalError { reason: String, }, NotImplemented { feature: String, }, IoError { operation: String, reason: String, }, JsonError { reason: String, }, ParseError { type_name: String, reason: String, }, RequestError { url: String, reason: String, }, ContainerError { reason: String, }, ImageError { reason: String, }, NetworkError { reason: String, }, RuntimeError { reason: String, }, RegistryError { reason: String, }, EtcdError { reason: String, }, MonitorError { reason: String, }, KubernetesError { reason: String, },
}
Expand description

统一错误类型枚举

整合所有模块的错误变体,每个变体对应一个 i18n key。

Variants§

§

InvalidFormat

无效格式

Fields

§field: String

字段名

§expected: String

期望格式

§

OutOfRange

值超出范围

Fields

§field: String

字段名

§min: Option<String>

最小值

§max: Option<String>

最大值

§

Required

必填字段缺失

Fields

§field: String

字段名

§

AlreadyExists

值已存在

Fields

§field: String

字段名

§value: String

§

NotAllowed

值不允许

Fields

§field: String

字段名

§allowed: Vec<String>

允许的值

§

InvalidParams

无效参数

Fields

§param: String

参数名

§reason: String

原因

§

InvalidCredentials

无效凭证

§

AccountLocked

账户已锁定

§

UserNotFound

用户未找到

Fields

§identifier: String

用户标识

§

UserAlreadyExists

用户已存在

Fields

§username: String

用户名

§

InvalidToken

无效令牌

Fields

§reason: String

原因

§

TokenExpired

令牌已过期

§

PermissionDenied

权限拒绝

Fields

§action: String

操作

§

Forbidden

禁止访问

Fields

§resource: String

资源

§

ResourceNotFound

资源未找到

Fields

§resource_type: String

资源类型

§identifier: String

资源标识

§

ResourceConflict

资源冲突

Fields

§resource: String

资源

§reason: String

原因

§

RateLimited

限流超出

Fields

§limit: u64

限制

§

ConnectionFailed

连接失败

Fields

§target: String

目标

§

DnsResolutionFailed

DNS 解析失败

Fields

§host: String

主机

§

ServiceUnavailable

服务不可用

Fields

§service: String

服务名

§

StorageReadFailed

读取失败

Fields

§path: String

路径

§

StorageWriteFailed

写入失败

Fields

§path: String

路径

§

StorageDeleteFailed

删除失败

Fields

§path: String

路径

§

InsufficientCapacity

容量不足

Fields

§required: u64

需要

§available: u64

可用

§

StorageFileNotFound

文件未找到

Fields

§path: String

路径

§

ConfigMissing

配置缺失

Fields

§key: String

配置键

§

ConfigInvalid

配置无效

Fields

§key: String

配置键

§reason: String

原因

§

InternalError

内部错误

Fields

§reason: String

原因

§

NotImplemented

未实现

Fields

§feature: String

功能

§

IoError

IO 错误

Fields

§operation: String

操作

§reason: String

原因

§

JsonError

JSON 错误

Fields

§reason: String

原因

§

ParseError

解析错误

Fields

§type_name: String

类型

§reason: String

原因

§

RequestError

请求错误

Fields

§url: String

URL

§reason: String

原因

§

ContainerError

容器错误

Fields

§reason: String

原因

§

ImageError

镜像错误

Fields

§reason: String

原因

§

NetworkError

网络错误

Fields

§reason: String

原因

§

RuntimeError

运行时错误

Fields

§reason: String

原因

§

RegistryError

注册表错误

Fields

§reason: String

原因

§

EtcdError

Etcd 错误

Fields

§reason: String

原因

§

MonitorError

监控错误

Fields

§reason: String

原因

§

KubernetesError

Kubernetes 错误

Fields

§reason: String

原因

Implementations§

Source§

impl DockerErrorKind

Source

pub fn category(&self) -> ErrorCategory

获取错误分类

Source

pub fn i18n_key(&self) -> &'static str

获取国际化键

Source

pub fn i18n_data(&self) -> Value

获取国际化数据

Trait Implementations§

Source§

impl Clone for DockerErrorKind

Source§

fn clone(&self) -> DockerErrorKind

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
Source§

impl Debug for DockerErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DockerErrorKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for DockerErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for DockerErrorKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,