Struct std::io::Sink

1.0.0 · source ·
#[non_exhaustive]
pub struct Sink;
Expand description

一个 writer,它将数据移入无效空间。

通常通过调用 sink 来创建此结构体。 请参见 sink() 的文档以获取更多详细信息。

Trait Implementations§

source§

impl Clone for Sink

source§

fn clone(&self) -> Sink

返回值的副本。 Read more
source§

fn clone_from(&mut self, source: &Self)

source 执行复制分配。 Read more
1.16.0 · source§

impl Debug for Sink

source§

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

使用给定的格式化程序格式化该值。 Read more
source§

impl Default for Sink

source§

fn default() -> Sink

返回类型的 “默认值”。 Read more
1.48.0 · source§

impl Write for &Sink

source§

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

在此 writer 中写入一个缓冲区,返回写入的字节数。 Read more
source§

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

类似于 write,不同之处在于它是从缓冲区切片中写入数据的。 Read more
source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector #69941)
确定此 Writer 是否具有有效的 write_vectored 实现。 Read more
source§

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

刷新此输出流,确保所有中间缓冲的内容均到达其目的地。 Read more
source§

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

尝试将整个缓冲区写入此 writer。 Read more
source§

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

🔬This is a nightly-only experimental API. (write_all_vectored #70436)
尝试将多个缓冲区写入此 writer。 Read more
source§

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

将格式化的字符串写入此 writer,返回遇到的任何错误。 Read more
source§

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

为这个 Write 实例创建一个 “by reference” 适配器。 Read more
source§

impl Write for Sink

source§

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

在此 writer 中写入一个缓冲区,返回写入的字节数。 Read more
source§

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

类似于 write,不同之处在于它是从缓冲区切片中写入数据的。 Read more
source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector #69941)
确定此 Writer 是否具有有效的 write_vectored 实现。 Read more
source§

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

刷新此输出流,确保所有中间缓冲的内容均到达其目的地。 Read more
source§

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

尝试将整个缓冲区写入此 writer。 Read more
source§

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

🔬This is a nightly-only experimental API. (write_all_vectored #70436)
尝试将多个缓冲区写入此 writer。 Read more
source§

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

将格式化的字符串写入此 writer,返回遇到的任何错误。 Read more
source§

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

为这个 Write 实例创建一个 “by reference” 适配器。 Read more
source§

impl Copy for Sink

Auto Trait Implementations§

§

impl RefUnwindSafe for Sink

§

impl Send for Sink

§

impl Sync for Sink

§

impl Unpin for Sink

§

impl UnwindSafe for Sink

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

获取 selfTypeIdRead more
source§

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

source§

fn borrow(&self) -> &T

从拥有的值中一成不变地借用。 Read more
source§

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

source§

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

从拥有的值中借用。 Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

返回未更改的参数。

source§

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

source§

fn into(self) -> U

调用 U::from(self)

也就是说,这种转换是 From<T> for U 实现选择执行的任何操作。

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

获得所有权后的结果类型。
source§

fn to_owned(&self) -> T

从借用的数据创建拥有的数据,通常是通过克隆。 Read more
source§

fn clone_into(&self, target: &mut T)

使用借来的数据来替换拥有的数据,通常是通过克隆。 Read more
source§

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

§

type Error = Infallible

发生转换错误时返回的类型。
source§

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

执行转换。
source§

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

§

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

发生转换错误时返回的类型。
source§

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

执行转换。