Struct stream_httparse::Request [−][src]
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]
protocol: &'a str,
method: Method,
path: &'a str,
headers: Headers<'a>,
body: &'a [u8]
) -> Self
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,