跳到主要内容

Writer

结构体 Writer 

Source
pub struct Writer<'a> { /* private fields */ }
展开描述

A structure that implements std::io::Write 用于 writing 明文.

Trait 实现§

Source§

impl Write for Writer<'_>

Source§

fn write(&mut self, buf: &[u8]) -> Result<usize>

发送明文 buf 到 the peer, encrypting 并 authenticating it. Once 此函数 succeeds you should call Connection::write_tls which will output the corresponding TLS records.

This function buffers 明文 sent before the TLS handshake completes, 并 sends it as soon as it can. ,请参见ConnectionCommon::set_buffer_limit 到 control the size of this 缓冲区.

Source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize>

Like write, except that it writes from a slice of buffers. 更多信息
Source§

fn flush(&mut self) -> Result<()>

Flushes this output stream, ensuring that all intermediately buffered contents reach their destination. 更多信息
Source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored implementation. 更多信息
1.0.0 · Source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts 到 write an entire 缓冲区 into this writer. 更多信息
Source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts 到 write multiple buffers into this writer. 更多信息
1.0.0 · Source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Writes 一个 formatted string into this writer, returning any error encountered. 更多信息
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Creates 一个 “by reference” adapter 用于 this instance of Write. 更多信息

自动 Trait 实现§

§

impl<'a> Freeze for Writer<'a>

§

impl<'a> !RefUnwindSafe for Writer<'a>

§

impl<'a> !Send for Writer<'a>

§

impl<'a> !Sync for Writer<'a>

§

impl<'a> Unpin for Writer<'a>

§

impl<'a> UnsafeUnpin for Writer<'a>

§

impl<'a> !UnwindSafe for Writer<'a>

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>

执行转换。