HandlerAttributesBinding

Struct HandlerAttributesBinding 

Source
pub struct HandlerAttributesBinding<'a> { /* private fields */ }
Expand description

A wrapper that implements the AttributesBinding trait for the handlers provided by the PDK.

Implementations§

Source§

impl<'a> HandlerAttributesBinding<'a>

Source

pub fn new( handler: &'a dyn HeadersHandler, properties: &'a dyn PropertyAccessor, ) -> Self

Will create a binding that will resolve all properties of the attributes variable.

Source

pub fn partial(handler: &'a dyn HeadersHandler) -> Self

Will create a binding that won’t be able to resolve remote_address, local_address, scheme or version

Trait Implementations§

Source§

impl AttributesBinding for HandlerAttributesBinding<'_>

Source§

fn extract_headers(&self) -> HashMap<String, String>

Returns the entire headers map.
Source§

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

Returns a single header.
Source§

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

Returns the attributes.remoteAddress value.
Source§

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

Returns the attributes.localAddress value.
Source§

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

Returns the attributes.scheme value.
Source§

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

Returns the attributes.version value.
Source§

fn extract_query_params(&self) -> HashMap<String, String>

Returns a map with the query parameters.
Source§

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

Returns the attributes.method value.
Source§

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

Returns the attributes.path value.
Source§

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

Returns the uri value.
Source§

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

Returns the attributes.queryString value.
Source§

fn status_code(&self) -> Option<u32>

Returns the attributes.statusCode value.

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<C, T> Extract<T> for C
where T: FromContext<C>,

Source§

type Error = <T as FromContext<C>>::Error

Source§

fn extract(&self) -> Result<T, <C as Extract<T>>::Error>

Source§

fn extract_always(&self) -> T
where Self: Extract<T, Error = Infallible>,

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.