[−][src]Struct krill::daemon::http::Request
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,