Struct multipart::mock::HttpBuffer [] [src]

pub struct HttpBuffer {
    pub buf: Vec<u8>,
    pub boundary: String,
    pub content_len: Option<u64>,
    // some fields omitted
}

A writable buffer which stores the boundary and content-length, if provided.

Implements client::HttpStream if the client feature is enabled.

Fields

The buffer containing the raw bytes.

The multipart boundary.

The value of the content-length header, if set.

Methods

impl HttpBuffer
[src]

[src]

Create an empty buffer with the given boundary and optional content-length.

[src]

Wrap the given buffer with the given boundary and optional content-length.

[src]

Get a ServerRequest wrapping the data in this buffer.

Trait Implementations

impl Write for HttpBuffer
[src]

[src]

To simulate a network connection, this will copy a random number of bytes from buf to the buffer.

[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

impl HttpStream for HttpBuffer
[src]

The request type that opened this stream.

The response type that will be returned after the request is completed.

The error type for this stream. Must be compatible with io::Error as well as Self::Request::Error. Read more

[src]

Returns Ok(self).

impl Debug for HttpBuffer
[src]

[src]

Formats the value using the given formatter.