[][src]Trait http_sig::ServerRequestLike

pub trait ServerRequestLike: RequestLike {
    type Remnant;
    fn complete_with_digest(
        self,
        digest: &dyn HttpDigest
    ) -> (Option<String>, Self::Remnant);
fn complete(self) -> Self::Remnant; }

This trait is to be implemented for types representing an incoming HTTP request. The HTTP verification extension methods are available on any type implementing this trait.

Typically this trait is implemented for references or mutable references to those request types rather than for the request type itself.

Associated Types

type Remnant

For some request types, the verification process may be a destructive operation. This associated type can be used to return information that might otherwise be lost.

Loading content...

Required methods

fn complete_with_digest(
    self,
    digest: &dyn HttpDigest
) -> (Option<String>, Self::Remnant)

Complete the verification process, indicating that we want to compute a digest of the request body. This may require buffering the whole request body into memory.

If a request body was present, its digest should be returned as the first element of the tuple. Otherwise None should be returned. The second tuple element may contain any information the implementation wants returned to the caller (for example the buffered request body, if it had to be removed from the request).

fn complete(self) -> Self::Remnant

Complete the verification process without attempting to compute a digest.

Loading content...

Implementations on Foreign Types

impl<'a> ServerRequestLike for &'a Request[src]

type Remnant = Option<RouilleBody<'a>>

Loading content...

Implementors

impl<'a> ServerRequestLike for &'a MockRequest[src]

type Remnant = ()

Loading content...