pub struct RequestBody { /* private fields */ }Implementations§
Source§impl RequestBody
impl RequestBody
pub fn new(req: Request<Incoming>) -> Self
pub fn params(&self) -> &HashMap<String, String>
pub fn method(&self) -> &Method
pub fn path(&self) -> &str
pub fn headers(&self) -> &HeaderMap
pub fn set_headers(&mut self, key: &str, value: &str)
pub fn get_headers(&mut self, key: &str) -> Option<&HeaderValue>
pub fn uri(&self) -> &Uri
pub fn version(&self) -> Version
pub fn query(&self) -> HashMap<String, String>
pub fn query_param(&self, key: &str) -> Option<String>
pub async fn bytes(self) -> Result<Bytes, Error>
pub async fn text(self) -> Result<String, Box<dyn Error>>
pub async fn json<T: DeserializeOwned>(self) -> Result<T, Box<dyn Error>>
Auto Trait Implementations§
impl !Freeze for RequestBody
impl !RefUnwindSafe for RequestBody
impl Send for RequestBody
impl Sync for RequestBody
impl Unpin for RequestBody
impl !UnwindSafe for RequestBody
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