Skip to main content

serve_with_selected_pack_policy

Function serve_with_selected_pack_policy 

Source
pub fn serve_with_selected_pack_policy<R: Repository + ?Sized, W: Write>(
    repository: &ValidatedRepository<'_, '_, R>,
    request: Request<'_>,
    storage: &mut SelectionStorage<'_>,
    options: WantOptions,
    output: &mut W,
    write_selected: impl FnOnce(&[usize], &mut [u8], &mut PackOutput<'_, W>) -> Result<()>,
) -> Result<Response>
Expand description

Apply an explicit host want policy before the selected-pack writer or cache. Every request, including hits and ACK-only rounds, is checked independently. Keep the authorized repository projection immutable for the entire call. Output and writer-failure contracts match serve_with_selected_pack.