Struct RequestAttributes

Source
pub struct RequestAttributes(/* private fields */);
Expand description

Available in HTTP filters during a request.

Implementations§

Source§

impl RequestAttributes

Source

pub fn path(&self) -> Option<String>

The path portion of the URL

Source

pub fn url_path(&self) -> Option<String>

The path portion of the URL without the query string

Source

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

The host portion of the URL

Source

pub fn scheme(&self) -> Option<String>

The scheme portion of the URL e.g. “http”

Source

pub fn method(&self) -> Option<String>

Request method e.g. “GET”

Source

pub fn headers(&self) -> Option<Vec<(String, Vec<u8>)>>

All request headers indexed by the lower-cased header name Header values in request.headers associative array are comma-concatenated in case of multiple values.

Source

pub fn referer(&self) -> Option<String>

Referer request header

Source

pub fn useragent(&self) -> Option<String>

User agent request header

Source

pub fn time(&self) -> Option<SystemTime>

Time of the first byte received

Source

pub fn id(&self) -> Option<String>

Request ID corresponding to x-request-id header value

Source

pub fn protocol(&self) -> Option<String>

Request protocol (“HTTP/1.0”, “HTTP/1.1”, “HTTP/2”, or “HTTP/3”)

Source

pub fn query(&self) -> Option<String>

The query portion of the URL in the format of “name1=value1&name2=value2”.

Source

pub fn duration(&self) -> Option<Duration>

Total duration of the request Available in HTTP filters after a request is complete.

Source

pub fn size(&self) -> Option<usize>

Size of the request body. Content length header is used if available. Available in HTTP filters after a request is complete.

Source

pub fn total_size(&self) -> Option<usize>

Total size of the request including the approximate uncompressed size of the headers Available in HTTP filters after a request is complete.

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<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, 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.