[][src]Struct krill::daemon::http::Request

pub struct Request { /* fields omitted */ }

Implementations

impl Request[src]

pub fn new(request: Request<Body>, state: State) -> Self[src]

pub fn path(&self) -> &RequestPath[src]

Returns the complete path.

pub fn state(&self) -> &State[src]

Get the application State

pub fn method(&self) -> &Method[src]

Returns the method of this request.

pub fn is_get(&self) -> bool[src]

Returns whether the request is a GET request.

pub fn is_post(&self) -> bool[src]

Returns whether the request is a GET request.

pub fn is_delete(&self) -> bool[src]

Returns whether the request is a DELETE request.

pub async fn json<O: DeserializeOwned>(self) -> Result<O, Error>[src]

Get a json object from a post body

pub async fn api_bytes(self) -> Result<Bytes, Error>[src]

pub async fn rfc6492_bytes(self) -> Result<Bytes, Error>[src]

pub async fn rfc8181_bytes(self) -> Result<Bytes, Error>[src]

pub async fn read_bytes(self, limit: u64) -> Result<Bytes, Error>[src]

See hyper::body::to_bytes

Here we want to limit the bytes consumed to a maximum. So, the code below is adapted from the method in the hyper crate.

pub async fn is_authorized<'_>(&'_ self) -> bool[src]

Checks whether the Bearer token is set to what we expect

Auto Trait Implementations

impl !RefUnwindSafe for Request

impl Send for Request

impl Sync for Request

impl Unpin for Request

impl !UnwindSafe for Request

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.