pub trait ServerRequestLike: RequestLike {
    type Remnant;

    // Required methods
    fn complete_with_digest(
        self,
        digest: &dyn HttpDigest
    ) -> (Option<String>, Self::Remnant);
    fn complete(self) -> Self::Remnant;
}
Expand description

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.

Required Associated Types§

source

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.

Required Methods§

source

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

source

fn complete(self) -> Self::Remnant

Complete the verification process without attempting to compute a digest.

Implementations on Foreign Types§

source§

impl<'a> ServerRequestLike for &'a Request

§

type Remnant = Option<RouilleBody<'a>>

source§

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

source§

fn complete(self) -> Self::Remnant

Implementors§