pub fn should_stream(
policy: &StreamingPolicy,
size_hint: &SizeHint,
content_type: Option<&str>,
content_length: Option<u64>,
) -> StreamingDecisionExpand description
Determines how to handle a response body based on size hints and content type.
This function implements the core streaming decision logic by examining:
- Whether streaming is enabled in the policy
- Content-Type header (fast path for exclusions/forced caching)
- Size hints from the body
- Content-Length header as fallback
§Arguments
policy- The streaming policy configurationsize_hint- Size hint from the response bodycontent_type- Content-Type header value, if presentcontent_length- Content-Length header value, if present
§Returns
A StreamingDecision indicating how to handle the body.