[−][src]Function http_serve::serve
pub fn serve<Ent: Entity, B: Body + From<Box<dyn Stream<Item = Result<Ent::Data, Ent::Error>> + Send + Sync>>, BI>(
entity: Ent,
req: &Request<BI>
) -> Response<B>
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.