Struct hprose::io::ByteWriter [] [src]

pub struct ByteWriter {
    pub vec: Bytes,
}

Fields

Methods

impl ByteWriter
[src]

Constructs a new ByteWriter.

Converts a ByteWriter into a byte vector.

This consumes the ByteWriter, so we do not need to copy its contents.

Returns a byte slice of this ByteWriter's contents.

Converts the contents of a ByteWriter to a String.

Errors

Returns Err if the slice is not UTF-8 with a description as to why the provided bytes are not UTF-8. The vector you moved in is also included.

Clears the vector, Removing all bytes.

Returns the number of bytes in the vector.

Writes a byte to the end of the vector.

Panics

Panics if the number of elements in the vector overflows a usize.

Writes all the bytes to the end of the vector.

Panics

Panics if the number of elements in the vector overflows a usize.