Struct HttpContext

Source
pub struct HttpContext {
Show 18 fields pub keep_alive_backend: bool, pub keep_alive_frontend: bool, pub sticky_session_found: Option<String>, pub method: Option<Method>, pub authority: Option<String>, pub path: Option<String>, pub status: Option<u16>, pub reason: Option<String>, pub user_agent: Option<String>, pub closing: bool, pub id: Ulid, pub backend_id: Option<String>, pub cluster_id: Option<String>, pub protocol: Protocol, pub public_address: SocketAddr, pub session_address: Option<SocketAddr>, pub sticky_name: String, pub sticky_session: Option<String>,
}
Expand description

This is the container used to store and use information about the session from within a Kawa parser callback

Fields§

§keep_alive_backend: bool

set to false if Kawa finds a “Connection” header with a “close” value in the response

§keep_alive_frontend: bool

set to false if Kawa finds a “Connection” header with a “close” value in the request

§sticky_session_found: Option<String>

the value of the sticky session cookie in the request

§method: Option<Method>

the value of the method in the request line

§authority: Option<String>

the value of the authority of the request (in the request line of “Host” header)

§path: Option<String>

the value of the path in the request line

§status: Option<u16>

the value of the status code in the response line

§reason: Option<String>

the value of the reason in the response line

§user_agent: Option<String>§closing: bool

signals wether Kawa should write a “Connection” header with a “close” value (request and response)

§id: Ulid

the value of the custom header, named “Sozu-Id”, that Kawa should write (request and response)

§backend_id: Option<String>§cluster_id: Option<String>§protocol: Protocol

the value of the protocol Kawa should write in the Forwarded headers of the request

§public_address: SocketAddr

the value of the public address Kawa should write in the Forwarded headers of the request

§session_address: Option<SocketAddr>

the value of the session address Kawa should write in the Forwarded headers of the request

§sticky_name: String

the name of the cookie Kawa should read from the request to get the sticky session

§sticky_session: Option<String>

the sticky session that should be used used to create a “Set-Cookie” header in the response in case it differs from sticky_session_found

Implementations§

Source§

impl HttpContext

Source

pub fn reset(&mut self)

Source

pub fn log_context(&self) -> LogContext<'_>

Trait Implementations§

Source§

impl Debug for HttpContext

Source§

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

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

impl ParserCallbacks<Checkout> for HttpContext

Source§

fn on_headers(&mut self, stream: &mut Kawa<Checkout>)

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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, U> Into<U> for T
where 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,