pub trait Request: 'static + Send {
Show 16 methods
// Required methods
fn peer_addr(&self) -> Option<String>;
fn local_addr(&self) -> Option<String>;
fn remote(&self) -> Option<String>;
fn host(&self) -> Option<String>;
fn path(&self) -> &str;
fn method(&self) -> Method;
fn content_type(&self) -> Option<String>;
fn header(&self, key: impl Into<HeaderName>) -> Option<HeaderValue>;
fn header_all(&self, key: impl Into<HeaderName>) -> Vec<HeaderValue>;
fn param(&self, key: &str) -> HttpResult<&str>;
fn query<T: DeserializeOwned>(&self) -> HttpResult<T>;
fn body_string<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = HttpResult<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn body_bytes<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = HttpResult<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn body_json<'life0, 'async_trait, T>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = HttpResult<T>> + Send + 'async_trait>>
where T: 'async_trait + DeserializeOwned,
Self: 'async_trait,
'life0: 'async_trait;
fn body_form<'life0, 'async_trait, T>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = HttpResult<T>> + Send + 'async_trait>>
where T: 'async_trait + DeserializeOwned,
Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn get_cookie(&self, cookie_name: &str) -> Option<String> { ... }
}Required Methods§
fn peer_addr(&self) -> Option<String>
fn local_addr(&self) -> Option<String>
fn remote(&self) -> Option<String>
fn host(&self) -> Option<String>
fn path(&self) -> &str
fn method(&self) -> Method
fn content_type(&self) -> Option<String>
fn header(&self, key: impl Into<HeaderName>) -> Option<HeaderValue>
fn header_all(&self, key: impl Into<HeaderName>) -> Vec<HeaderValue>
fn param(&self, key: &str) -> HttpResult<&str>
fn query<T: DeserializeOwned>(&self) -> HttpResult<T>
fn body_string<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = HttpResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn body_bytes<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = HttpResult<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn body_json<'life0, 'async_trait, T>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = HttpResult<T>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned,
Self: 'async_trait,
'life0: 'async_trait,
fn body_form<'life0, 'async_trait, T>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = HttpResult<T>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned,
Self: 'async_trait,
'life0: 'async_trait,
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.