跳到主要内容

Error

搜索

枚举 Error 

Source
#[non_exhaustive]
pub enum Error { MissingSectionEnd { end_marker: Vec<u8>, }, IllegalSectionStart { line: Vec<u8>, }, Base64Decode(String), Io(Error), NoItemsFound, SectionTooLarge, }
展开描述

解析 PEM 文件内容时可能发生的错误

变体 (Non-exhaustive)§

This enum is marked as non-exhaustive
非穷尽枚举未来可能添加新的变体。因此,在对非穷尽枚举的变体进行模式匹配时,必须额外增加一个通配符分支以涵盖未来的新变体。
§

MissingSectionEnd

某个 section 缺少 "END marker" 行

字段

§end_marker: Vec<u8>

未能找到的 "END marker" 行

§

IllegalSectionStart

在开始新 section 的行中发现语法错误

字段

§line: Vec<u8>

包含语法错误的行

§

Base64Decode(String)

base64 decode error

§

Io(Error)

I/O 错误,来自接受 std::io 类型的 API。

§

NoItemsFound

未找到期望类型的条目

§

SectionTooLarge

PEM section 超过最大允许大小 256 MB

trait 实现§

Source§

impl Debug for Error

Source§

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

使用给定的格式化器格式化该值。更多信息
Source§

impl Display for Error

Source§

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

使用给定的格式化器格式化该值。更多信息
Source§

impl Error for Error

Available on crate feature std only.
1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

返回此错误的更底层来源(若有)。 更多信息
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. 更多信息

自动 trait 实现§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl !UnwindSafe for Error

blanket 实现§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 更多信息
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. 更多信息
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 更多信息
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

原样返回参数。

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

调用 U::from(self)

即此转换的实际行为取决于 From<T> for U 的实现。

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 更多信息
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

转换出错时返回的类型。
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行转换。
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

转换出错时返回的类型。
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

执行转换。