Function http_serve::serve
source · pub fn serve<E: Entity, P: Payload + From<Box<dyn Stream<Item = E::Data, Error = E::Error> + Send>>, PI>(
e: E,
req: &Request<PI>
) -> Response<P>
Expand description
Serves GET and HEAD requests for a given byte-ranged entity.
Handles conditional & subrange requests.
The caller is expected to have already determined the correct entity and appended
Expires
, Cache-Control
, and Vary
headers if desired.