Struct eve_rs::DefaultContext

source ·
pub struct DefaultContext { /* private fields */ }

Implementations§

source§

impl DefaultContext

source

pub fn get_body_object(&self) -> Option<&Value>

source

pub fn set_body_object(&mut self, body: Value)

source

pub fn new(request: Request) -> Self

Trait Implementations§

source§

impl Context for DefaultContext

source§

fn get_request(&self) -> &Request

source§

fn get_request_mut(&mut self) -> &mut Request

source§

fn get_response(&self) -> &Response

source§

fn take_response(self) -> Response

source§

fn get_response_mut(&mut self) -> &mut Response

source§

fn get_body(&self) -> Result<String, Utf8Error>

source§

fn json<TBody>(&mut self, body: TBody) -> &mut Selfwhere TBody: Serialize,

source§

fn body(&mut self, string: &str) -> &mut Self

source§

fn body_bytes(&mut self, bytes: &[u8]) -> &mut Self

source§

fn get_method(&self) -> &HttpMethod

source§

fn get_status(&self) -> u16

source§

fn get_status_message(&self) -> &str

source§

fn status(&mut self, code: u16) -> &mut Self

source§

fn content_type(&mut self, content_type: &str) -> &mut Self

source§

fn content_length(&mut self, length: usize) -> &mut Self

source§

fn redirect(&mut self, destination: &str) -> &mut Self

source§

fn attachment(&mut self, file_name: Option<&str>) -> &mut Self

source§

fn get_path(&self) -> String

source§

fn get_full_url(&self) -> String

source§

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

source§

fn get_query_string(&self) -> String

source§

fn get_host(&self) -> String

source§

fn get_host_and_port(&self) -> String

source§

fn get_content_type(&self) -> String

source§

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

source§

fn get_protocol(&self) -> String

source§

fn is_secure(&self) -> bool

source§

fn get_ip(&self) -> IpAddr

source§

fn is(&self, mimes: &[&str]) -> bool

source§

fn get_header(&self, key: &str) -> Option<String>

source§

fn header(&mut self, key: &str, value: &str) -> &mut Self

source§

fn append_header(&mut self, key: &str, value: &str) -> &mut Self

source§

fn remove_header(&mut self, key: &str) -> &mut Self

source§

fn get_cookies(&self) -> &Vec<Cookie>

source§

fn cookie(&mut self, cookie: Cookie) -> &mut Self

source§

fn last_modified(&mut self, last_modified: &str) -> &mut Self

source§

fn etag(&mut self, etag: &str) -> &mut Self

source§

impl Debug for DefaultContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<TData> Middleware<DefaultContext, ()> for DefaultMiddleware<TData>where TData: Default + Clone + Send + Sync,

source§

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§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more