跳到主要内容

TryGetError

搜索

结构体 TryGetError 

Source
pub struct TryGetError {
    pub requested: usize,
    pub available: usize,
}
展开描述

Buftry_get_ 方法的错误类型。 表明在尝试使用某个 try_get_ 方法从 Buf 获取值时, 缓冲区中没有足够的剩余字节。

字段§

§requested: usize

获取该值所需的字节数

§available: usize

缓冲区中可用的字节数

Trait 实现§

Source§

impl Debug for TryGetError

Source§

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

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

impl Display for TryGetError

Source§

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

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

impl Error for TryGetError

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. 更多信息
Source§

impl From<TryGetError> for Error

Available on crate feature std only.
Source§

fn from(error: TryGetError) -> Self

从输入类型转换为此类型。
Source§

impl PartialEq for TryGetError

Source§

fn eq(&self, other: &TryGetError) -> bool

测试 selfother 值是否相等,供 == 运算符使用。
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

测试 != 运算符。默认实现几乎总是够用,除非有非常充分的理由,否则不应被覆盖。
Source§

impl Eq for TryGetError

Source§

impl StructuralPartialEq for TryGetError

自动 Trait 实现§

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)

That is, this conversion is whatever the implementation of 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>

执行转换。