跳到主要内容

IoState

结构体 IoState 

Source
pub struct IoState { /* private fields */ }
展开描述

Values of this structure are returned 从 Connection::process_new_packets 并 tell the caller the current I/O state of the TLS connection.

实现§

Source§

impl IoState

Source

pub fn tls_bytes_to_write(&self) -> usize

如果立刻调用以下方法,可写入的字节数: Connection::write_tls if called right now. 非零值霖宣讀以下方法返回 true: CommonState::wants_write

Source

pub fn plaintext_bytes_to_read(&self) -> usize

通过 std::io::Read 能够获取的明文字节数: std::io::Read 无需额外的 I/O。

Source

pub fn peer_has_closed(&self) -> bool

如果对等方已发送 close_notify 警报,则为 true。 This is the TLS mechanism 到 securely half-close 一个 TLS connection, 并 signifies that the peer will not send any further data on this connection.

这会通过返回 Ok(0)std::io::Read表示,在所有已接收字节处理完毕后 retrieved.

Trait 实现§

Source§

impl Debug for IoState

Source§

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

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

impl PartialEq for IoState

Source§

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

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

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

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

impl Eq for IoState

Source§

impl StructuralPartialEq for IoState

自动 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 从 an owned value. 更多信息
Source§

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

Source§

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

Mutably borrows 从 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

Calls U::从(self)

That is, this conversion is whatever the implementation of From<T> 用于 U 的实现方式。

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>

执行转换。