Struct stream_httparse::Request[][src]

pub struct Request<'a> { /* fields omitted */ }

Represents a single HTTP-Request

Implementations

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

pub fn new(
    protocol: &'a str,
    method: Method,
    path: &'a str,
    headers: Headers<'a>,
    body: &'a [u8]
) -> Self
[src]

Creates a new Request with the given Data as its initial Data

pub fn serialize(&self) -> (Vec<u8>, &[u8])[src]

Serializes the Request and returns the final Data as a tuple of (HTTP-Head, HTTP-Body)

pub fn protocol(&self) -> &'a str[src]

Returns the Protocol of the Request

pub fn method(&self) -> &Method[src]

Returns the Method of the Request

pub fn path(&self) -> &'a str[src]

Returns the Path of the Request

pub fn headers(&self) -> &Headers<'a>[src]

Returns the Headers of the Request

pub fn header_mut(&mut self) -> &mut Headers<'a>[src]

Returns a mutable Reference to the Headers of the Request

pub fn body(&self) -> &[u8][src]

Returns the Body of the Request

pub fn is_keep_alive(&self) -> bool[src]

Checks if the Requests expects a Keep-alive connection

pub fn set_path(&'a mut self, n_path: &'a str)[src]

Overwrites the Path with the new Path

Trait Implementations

impl<'a> Debug for Request<'a>[src]

impl Display for Request<'_>[src]

impl<'a> PartialEq<Request<'a>> for Request<'a>[src]

impl<'a> StructuralPartialEq for Request<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Request<'a>

impl<'a> Send for Request<'a>

impl<'a> Sync for Request<'a>

impl<'a> Unpin for Request<'a>

impl<'a> UnwindSafe for Request<'a>

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<T> ToString for T where
    T: Display + ?Sized
[src]

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.