Struct Writer

Source
pub struct Writer<B> { /* private fields */ }
Expand description

An adapter for BufMut that implements both Write and AsyncWrite.

Trait Implementations§

Source§

impl<B: BufMut + Unpin> AsyncWrite for Writer<B>

Source§

type Error = WriterError

Error type for IO operations involving the writer.
Source§

fn poll_write_slice( self: Pin<&mut Self>, _: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Self::Error>>

Poll the writer and try to write some bytes from buf to it. Read more
Source§

fn poll_flush_once( self: Pin<&mut Self>, _: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Poll the writer and try to flush it only once.
Source§

impl<B: Clone> Clone for Writer<B>

Source§

fn clone(&self) -> Writer<B>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<B: Debug> Debug for Writer<B>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<B: BufMut> Write for Writer<B>

Source§

type Error = WriterError

Error type for IO operations involving the writer.
Source§

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

Write some bytes from buf to the writer. Read more
Source§

fn flush_once(&mut self) -> Result<(), Self::Error>

Flush this writer once ensuring all bytes reach their destination. Read more
Source§

impl<B: Copy> Copy for Writer<B>

Auto Trait Implementations§

§

impl<B> Freeze for Writer<B>
where B: Freeze,

§

impl<B> RefUnwindSafe for Writer<B>
where B: RefUnwindSafe,

§

impl<B> Send for Writer<B>
where B: Send,

§

impl<B> Sync for Writer<B>
where B: Sync,

§

impl<B> Unpin for Writer<B>
where B: Unpin,

§

impl<B> UnwindSafe for Writer<B>
where B: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsyncWriteExt for T
where T: AsyncWrite + ?Sized,

Source§

fn poll_write_buf<B>( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut B, ) -> Poll<Result<(), Self::Error>>
where B: Buf + ?Sized,

Poll the writer and try to write buf to it.
Source§

fn poll_write_buf_all<B>( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut B, ) -> Poll<Result<(), Self::Error>>
where B: Buf + ?Sized,

Poll the writer and try to write buf to it.
Source§

fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Poll the writer and try to flush it.
Source§

fn write_buf<B>(&mut self, buf: B) -> WriteBuf<'_, Self, B>
where B: Buf + Unpin, Self: Unpin,

Asynchronously write buf to the writer advancing it appropriately Read more
Source§

fn write_buf_all<B>(&mut self, buf: B) -> WriteBufAll<'_, Self, B>
where B: Buf + Unpin, Self: Unpin,

Asynchronously write buf to the writer advancing it until all of it has been written. Read more
Source§

fn flush(&mut self) -> Flush<'_, Self>
where Self: Unpin,

Asynchronously flush the writer. Read more
Source§

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

Create a “by reference” adapter that takes the current instance of AsyncWrite by mutable reference.
Source§

fn transaction( self, kind: WriteTransactionKind<'_>, ) -> WriteTransactionVariant<'_, Self>
where Self: Sized,

Available on crate feature alloc only.
Create a transaction that uses this instance of AsyncWrite. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoWrite<Native<T>> for T
where T: Write,

Source§

fn into_write(self) -> Native<T>

Convert self to a writer T.
Source§

impl<T> IntoWrite<NativeAsync<T>> for T
where T: AsyncWrite,

Source§

fn into_write(self) -> NativeAsync<T>

Convert self to a writer T.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

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

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> WriteExt for T
where T: Write + ?Sized,

Source§

fn write_buf<B>(&mut self, buf: B) -> Result<(), Self::Error>
where B: Buf,

Write buf to the writer advancing it appropriately.
Source§

fn write_buf_all<B>(&mut self, buf: B) -> Result<(), Self::Error>
where B: Buf,

Write buf to the writer advancing it until all of it has been written. Read more
Source§

fn flush(&mut self) -> Result<(), Self::Error>

Flush this writer ensuring all bytes reach their destination.
Source§

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

Create a “by reference” adapter that takes the current instance of Write by mutable reference.
Source§

fn transaction( self, kind: WriteTransactionKind<'_>, ) -> WriteTransactionVariant<'_, Self>
where Self: Sized,

Available on crate feature alloc only.
Create a transaction that uses this writer. Read more