Struct bytecodec::io::WriteBuf[][src]

pub struct WriteBuf<B> { /* fields omitted */ }

Write buffer.

Methods

impl<B: AsRef<[u8]> + AsMut<[u8]>> WriteBuf<B>
[src]

Makes a new WriteBuf instance.

Returns the number of encoded bytes in the buffer.

Returns the free space of the buffer.

Invariant: self.len() + self.room() <= self.capacity()

Returns the capacity of the buffer.

Returns true if the buffer is empty, otherwise false.

Returns true if the buffer is full, otherwise false.

Returns the state of the stream that operated in the last flush() call.

Returns a mutable reference to the StreamState instance.

Writes the encoded bytes contained in this buffer to the given writer.

The written bytes will be removed from the buffer.

The flush process continues until one of the following condition is satisfied:

  • The write buffer became empty
  • A write operation returned a WouldBlock error
  • The output stream has reached EOS

Important traits for &'a mut R

Returns a reference to the inner bytes of the buffer.

Important traits for &'a mut R

Returns a mutable reference to the inner bytes of the buffer.

Takes ownership of ReadBuf and returns the inner bytes of the buffer.

Trait Implementations

impl<B: Debug> Debug for WriteBuf<B>
[src]

Formats the value using the given formatter. Read more

impl<B: AsRef<[u8]> + AsMut<[u8]>> Write for WriteBuf<B>
[src]

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Important traits for &'a mut R

Creates a "by reference" adaptor for this instance of Write. Read more

Auto Trait Implementations

impl<B> Send for WriteBuf<B> where
    B: Send

impl<B> Sync for WriteBuf<B> where
    B: Sync