Request

Trait Request 

Source
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§

Source

fn peer_addr(&self) -> Option<String>

Source

fn local_addr(&self) -> Option<String>

Source

fn remote(&self) -> Option<String>

Source

fn host(&self) -> Option<String>

Source

fn path(&self) -> &str

Source

fn method(&self) -> Method

Source

fn content_type(&self) -> Option<String>

Source

fn header(&self, key: impl Into<HeaderName>) -> Option<HeaderValue>

Source

fn header_all(&self, key: impl Into<HeaderName>) -> Vec<HeaderValue>

Source

fn param(&self, key: &str) -> HttpResult<&str>

Source

fn query<T: DeserializeOwned>(&self) -> HttpResult<T>

Source

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,

Source

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,

Source

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,

Source

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.

Implementors§