Skip to main content

serve

Function serve 

Source
pub fn serve<F>(
    broker: &PathBroker,
    policy: &StreamPolicy,
    request: &Request<Vec<u8>>,
    respond: F,
)
where F: FnOnce(Response<Vec<u8>>) + Send + 'static,
Expand description

Serve one request. Validation (id, mime, stat, range) is synchronous and cheap; only the body read runs on a dedicated thread, then respond is called from there.