pub fn is_interim(headers: &[Header]) -> Res<bool> {
    let status = headers.iter().take(1).find(|h| h.name() == ":status");
    if let Some(h) = status {
        #[allow(clippy::map_err_ignore)]
        let status_code = h.value().parse::<i32>().map_err(|_| Error::InvalidHeader)?;
        if status_code == 101 {
            // https://datatracker.ietf.org/doc/html/draft-ietf-quic-http#section-4.3
            Err(Error::InvalidHeader)
        } else {
            Ok((100..200).contains(&status_code))
        }
    } else {
        Err(Error::InvalidHeader)
    }
}
/// Check whether the response is informational(1xx).
/// # Errors
/// Returns an error if response headers do not contain
/// a status header or if the value of the header is 101 or cannot be parsed.
Check whether the response is informational(1xx).
Check whether the response is informational ( 1xx ) .
pub fn is_interim(headers: &[Header]) -> Res<bool> {
    let status = headers.iter().take(1).find(|h| h.name() == ":status");
    if let Some(h) = status {
        #[allow(clippy::map_err_ignore)]
        let status_code = h.value().parse::<i32>().map_err(|_| Error::InvalidHeader)?;
        if status_code == 101 {
            // https://datatracker.ietf.org/doc/html/draft-ietf-quic-http#section-4.3
            Err(Error::InvalidHeader)
        } else {
            Ok((100..200).contains(&status_code))
        }
    } else {
        Err(Error::InvalidHeader)
    }
}
pub fn is_interim ( headers : & [ Header ] ) -> Res < bool > { let status = headers . iter ( ) . take ( 1 ) . find ( | h | h . name ( ) == " " ) ; if let Some ( h ) = status { # [ allow ( clippy map_err_ignore ) ] let status_code = h . value ( ) . parse :: < i32 > ( ) . map_err ( | _ | Error :: InvalidHeader ) ? ; if status_code == 101 { // https://datatracker.ietf.org/doc/html/draft-ietf-quic-http#section-4.3 Err ( Error :: InvalidHeader ) } else { Ok ( ( 100 .. 200 ) . contains ( & status_code ) ) } } else { Err ( Error :: InvalidHeader ) } }
Check whether the response is informational(1xx).
Check whether the response is informational ( 1xx ) .
headers
&[Header]
errors
Returns an error if response headers do not contain
a status header or if the value of the header is 101 or cannot be parsed.
Returns an error if response headers do not contain a status header or if the value of the header is 101 or cannot be parsed .