Struct eve_rs::DefaultContext
source · pub struct DefaultContext { /* private fields */ }
Implementations§
source§impl DefaultContext
impl DefaultContext
pub fn get_body_object(&self) -> Option<&Value>
pub fn set_body_object(&mut self, body: Value)
pub fn new(request: Request) -> Self
Trait Implementations§
source§impl Context for DefaultContext
impl Context for DefaultContext
fn get_request(&self) -> &Request
fn get_request_mut(&mut self) -> &mut Request
fn get_response(&self) -> &Response
fn take_response(self) -> Response
fn get_response_mut(&mut self) -> &mut Response
fn get_body(&self) -> Result<String, Utf8Error>
fn json<TBody>(&mut self, body: TBody) -> &mut Selfwhere TBody: Serialize,
fn body(&mut self, string: &str) -> &mut Self
fn body_bytes(&mut self, bytes: &[u8]) -> &mut Self
fn get_method(&self) -> &HttpMethod
fn get_status(&self) -> u16
fn get_status_message(&self) -> &str
fn status(&mut self, code: u16) -> &mut Self
fn content_type(&mut self, content_type: &str) -> &mut Self
fn content_length(&mut self, length: usize) -> &mut Self
fn redirect(&mut self, destination: &str) -> &mut Self
fn attachment(&mut self, file_name: Option<&str>) -> &mut Self
fn get_path(&self) -> String
fn get_full_url(&self) -> String
fn get_origin(&self) -> Option<String>
fn get_query_string(&self) -> String
fn get_host(&self) -> String
fn get_host_and_port(&self) -> String
fn get_content_type(&self) -> String
fn get_charset(&self) -> Option<String>
fn get_protocol(&self) -> String
fn is_secure(&self) -> bool
fn get_ip(&self) -> IpAddr
fn is(&self, mimes: &[&str]) -> bool
fn get_header(&self, key: &str) -> Option<String>
fn header(&mut self, key: &str, value: &str) -> &mut Self
fn append_header(&mut self, key: &str, value: &str) -> &mut Self
fn remove_header(&mut self, key: &str) -> &mut Self
fn last_modified(&mut self, last_modified: &str) -> &mut Self
fn etag(&mut self, etag: &str) -> &mut Self
source§impl Debug for DefaultContext
impl Debug for DefaultContext
source§impl<TData> Middleware<DefaultContext, ()> for DefaultMiddleware<TData>where
TData: Default + Clone + Send + Sync,
impl<TData> Middleware<DefaultContext, ()> for DefaultMiddleware<TData>where TData: Default + Clone + Send + Sync,
fn run_middleware<'life0, 'async_trait>( &'life0 self, context: DefaultContext, next: NextHandler<DefaultContext, ()> ) -> Pin<Box<dyn Future<Output = Result<DefaultContext, DefaultError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for DefaultContext
impl Send for DefaultContext
impl Sync for DefaultContext
impl Unpin for DefaultContext
impl !UnwindSafe for DefaultContext
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