pub struct Request { /* private fields */ }
Expand description
Represents an HTTP request.
§Fields
method
: The HTTP method of the request (e.g., GET, POST).host
: The host of the request (e.g., example.com).path
: The path of the request (e.g., /api/v1/resource).query
: The query string of the request (e.g., ?key=value).hash
: The fragment identifier of the request (e.g., #section).headers
: A collection of HTTP headers as key-value pairs.body
: The binary body of the request.
Implementations§
Source§impl Request
impl Request
pub fn get_method(&self) -> &Cow<'static, str>
pub fn set_method(&mut self, val: Cow<'static, str>) -> &mut Self
pub fn get_host(&self) -> &Cow<'static, str>
pub fn set_host(&mut self, val: Cow<'static, str>) -> &mut Self
pub fn get_path(&self) -> &Cow<'static, str>
pub fn set_path(&mut self, val: Cow<'static, str>) -> &mut Self
pub fn get_query(&self) -> &Cow<'static, str>
pub fn set_query(&mut self, val: Cow<'static, str>) -> &mut Self
pub fn get_hash(&self) -> &Cow<'static, str>
pub fn set_hash(&mut self, val: Cow<'static, str>) -> &mut Self
pub fn get_headers(&self) -> &HashMap<Cow<'static, str>, Cow<'static, str>>
pub fn set_headers( &mut self, val: HashMap<Cow<'static, str>, Cow<'static, str>>, ) -> &mut Self
pub fn get_body(&self) -> &Vec<u8>
pub fn set_body(&mut self, val: Vec<u8>) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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