[−][src]Struct salvo::prelude::Request
The Request
given to all Middleware
.
Stores all the properties of the client's request plus
an TypeMap
for data communication between middleware.
Methods
impl Request
[src]
pub fn from_hyper(
req: Request<Body>,
local_addr: Option<SocketAddr>,
protocol: &Protocol
) -> Result<Request, String>
[src]
req: Request<Body>,
local_addr: Option<SocketAddr>,
protocol: &Protocol
) -> Result<Request, String>
Create a request from an hyper::Request.
This constructor consumes the hyper::Request.
pub fn url(&self) -> &Url
[src]
pub fn method(&self) -> &Method
[src]
pub fn version(&self) -> HttpVersion
[src]
pub fn body(&self) -> Option<&Body>
[src]
pub fn take_body(&mut self) -> Option<Body>
[src]
pub fn accept(&self) -> Vec<Mime>
[src]
pub fn frist_accept(&self) -> Option<Mime>
[src]
pub fn content_type(&self) -> Option<Mime>
[src]
pub fn cookies(&self) -> &CookieJar
[src]
pub fn get_cookie<T>(&self, name: T) -> Option<&Cookie<'static>> where
T: AsRef<str>,
[src]
T: AsRef<str>,
pub fn headers(&self) -> &HeaderMap
[src]
pub fn get_header<K: AsHeaderName>(&self, key: K) -> Option<&HeaderValue>
[src]
pub fn params(&self) -> &HashMap<String, String>
[src]
pub fn get_param<'a, F>(&self, key: &'a str) -> Option<F> where
F: FromStr,
[src]
F: FromStr,
pub fn queries(&self) -> &MultiMap<String, String>
[src]
pub fn get_query<'a, F>(&self, key: &'a str) -> Option<F> where
F: FromStr,
[src]
F: FromStr,
pub async fn get_form<'a, '_, F>(&'_ mut self, key: &'a str) -> Option<F> where
F: FromStr,
[src]
F: FromStr,
pub async fn get_file<'a, '_, '_>(
&'_ mut self,
key: &'a str
) -> Option<&'_ FilePart>
[src]
&'_ mut self,
key: &'a str
) -> Option<&'_ FilePart>
pub async fn get_form_or_query<'a, '_, F>(
&'_ mut self,
key: &'a str
) -> Option<F> where
F: FromStr,
[src]
&'_ mut self,
key: &'a str
) -> Option<F> where
F: FromStr,
pub async fn get_query_or_form<'a, '_, F>(
&'_ mut self,
key: &'a str
) -> Option<F> where
F: FromStr,
[src]
&'_ mut self,
key: &'a str
) -> Option<F> where
F: FromStr,
pub async fn payload<'_, '_>(&'_ mut self) -> &'_ Result<Vec<u8>, ReadError>
[src]
pub async fn form_data<'_, '_>(&'_ mut self) -> &'_ Result<FormData, ReadError>
[src]
pub async fn read_from_json<'_, T>(&'_ mut self) -> Result<T, ReadError> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
pub async fn read_from_form<'_, T>(&'_ mut self) -> Result<T, ReadError> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
pub async fn read<'_, T>(&'_ mut self) -> Result<T, ReadError> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
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
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,
ⓘImportant traits for &'_ mut Ifn borrow_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'_ mut I
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,