Struct anterofit::net::body::RawBody [] [src]

pub struct RawBody<R>(_);

A wrapper around a type that is intended to be read directly as the request body, instead of being serialized.

Methods

impl<R: Read> RawBody<R>
[src]

Wrap a Read type and a content-type

impl<T: AsRef<[u8]>> RawBody<Cursor<T>>
[src]

Wrap anything Cursor can work with (such as String or Vec<u8>) as a raw request body.

Assumes application/octet-stream as the content-type.

Wrap anything Send + 'static that can deref to str (String, &'static str, Box<str>, etc) as a plain text body.

Assumes text/plain; charset=utf8 as the content-type.

impl RawBody<Cursor<String>>
[src]

Convert the ToString value to a String and wrap it.

Assumes text/plain; charset=utf8 as the content-type.

impl RawBody<Cursor<Vec<u8>>>
[src]

Use the serializer in adapter to serialize val as a raw body immediately.

Trait Implementations

impl<R: Debug> Debug for RawBody<R>
[src]

Formats the value using the given formatter.

impl<R: Read + Send + 'static> EagerBody for RawBody<R>
[src]

The readable request body.

Serialize self with the given adapter into a request body.

impl<R> From<Readable<R>> for RawBody<R>
[src]

Performs the conversion.