pub struct Request {
pub ip: SocketAddr,
pub url: String,
pub method: Method,
pub body: String,
pub headers: HashMap<String, String>,
}Expand description
A server request. Parses the raw request string into a more usable format.
Fields§
§ip: SocketAddr§url: String§method: Method§body: String§headers: HashMap<String, String>Implementations§
source§impl Request
impl Request
pub fn new(text: String, ip: SocketAddr) -> Self
pub fn get_header(&self, key: &str) -> Option<&str>
pub fn get_header_or(&self, key: &str, default: &'static str) -> &str
pub fn set_header<T, K>(&mut self, key: T, value: K)
Trait Implementations§
Auto Trait Implementations§
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