pub struct Request<'a> { /* private fields */ }
Expand description
Represents a single HTTP-Request
Implementations§
Source§impl<'a> Request<'a>
impl<'a> Request<'a>
Sourcepub fn new(
protocol: &'a str,
method: Method,
path: &'a str,
headers: Headers<'a>,
body: &'a [u8],
) -> Self
pub fn new( 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
Sourcepub fn serialize(&self) -> (Vec<u8>, &[u8])
pub fn serialize(&self) -> (Vec<u8>, &[u8])
Serializes the Request and returns the final Data as a tuple of (HTTP-Head, HTTP-Body)
Sourcepub fn header_mut(&mut self) -> &mut Headers<'a>
pub fn header_mut(&mut self) -> &mut Headers<'a>
Returns a mutable Reference to the Headers of the Request
Sourcepub fn is_keep_alive(&self) -> bool
pub fn is_keep_alive(&self) -> bool
Checks if the Requests expects a Keep-alive connection
Sourcepub fn set_path_ref<'b>(&mut self, n_path: &'b str)where
'b: 'a,
pub fn set_path_ref<'b>(&mut self, n_path: &'b str)where
'b: 'a,
Overwrites the Path with the new Path
Sourcepub fn set_path_owned(&mut self, n_path: String)
pub fn set_path_owned(&mut self, n_path: String)
Overwrites the Path with the new Path, but using an owned String instead of a reference
Trait Implementations§
impl<'a> StructuralPartialEq for Request<'a>
Auto Trait Implementations§
impl<'a> Freeze for Request<'a>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more