Skip to main content

ErrorKind

Enum ErrorKind 

Source
pub enum ErrorKind {
    SerializeError(String),
    DeserializeError(String),
    ValidateError(i64, String),
}
Expand description

列举 afastdata 可能产生的错误类型。

Enumerates the kinds of errors produced by afastdata.

Variants§

§

SerializeError(String)

序列化失败,携带文本消息。

Serialization failure with a textual message.

§

DeserializeError(String)

反序列化失败,携带文本消息。

Deserialization failure with a textual message.

§

ValidateError(i64, String)

验证失败,包含无效值和错误信息。

Validation failure, carrying the invalid value and a message.

Implementations§

Source§

impl ErrorKind

Source

pub fn message(&self) -> &str

返回错误消息的引用。

Returns a reference to the error message.

Source

pub fn code(&self) -> Option<i64>

返回验证错误码(仅 ValidateError 有值)。

Returns the validation error code. Returns None for non-validation errors.

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> 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, 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.