Struct stream_httparse::Request[][src]

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

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(&'a 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_ref<'b>(&mut self, n_path: &'b str) where
    'b: 'a, 
[src]

Overwrites the Path with the new Path

pub fn set_path_owned(&mut self, n_path: String)[src]

Overwrites the Path with the new Path, but using an owned String instead of a reference

pub fn set_body(&mut self, data: Vec<u8>)[src]

Replaces the current Body with the given Data

Trait Implementations

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

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Display for Request<'_>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

fn eq(&self, other: &Request<'a>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Request<'a>) -> bool[src]

This method tests for !=.

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.