[][src]Struct multipart::mock::ServerRequest

pub struct ServerRequest<'a> {
    pub data: &'a [u8],
    pub boundary: &'a str,
    pub content_len: Option<u64>,
    // some fields omitted
}

A mock implementation of server::HttpRequest that can be read.

Implements server::HttpRequest if the server feature is enabled.

Fields

data: &'a [u8]

Slice of the source HttpBuffer::buf

boundary: &'a str

The multipart boundary.

content_len: Option<u64>

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

Implementations

impl<'a> ServerRequest<'a>[src]

pub fn new(data: &'a [u8], boundary: &'a str) -> Self[src]

Create a new ServerRequest with the given data and boundary.

Assumes content_len: None

Trait Implementations

impl<'a> HttpRequest for ServerRequest<'a>[src]

type Body = Self

The body of this request.

impl<'a> Read for ServerRequest<'a>[src]

pub fn read(&mut self, out: &mut [u8]) -> Result<usize>[src]

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

Auto Trait Implementations

impl<'a> RefUnwindSafe for ServerRequest<'a>[src]

impl<'a> !Send for ServerRequest<'a>[src]

impl<'a> !Sync for ServerRequest<'a>[src]

impl<'a> Unpin for ServerRequest<'a>[src]

impl<'a> UnwindSafe for ServerRequest<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<R> ReadBytesExt for R where
    R: Read + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,