EKHEIJTI5NI3I5IIC5IIBC7XIAOCQ6PXV5WN5AXW3FIVDKPTG3NQC
impl From<(u8, Meta)> for Redirect {
fn from((code, meta): (u8, Meta)) -> Self {
#[derive(Error, Debug)]
#[error("failed to read mime: {0}")]
pub struct UrlError(#[from] url::ParseError);
impl TryFrom<(u8, Meta)> for Redirect {
type Error = UrlError;
fn try_from((code, meta): (u8, Meta)) -> Result<Self, Self::Error> {
4 => Some(Header::FailTemp((sub, meta).try_into()?)),
5 => Some(Header::FailPerm((sub, meta).try_into()?)),
6 => Some(Header::CertRequired((sub, meta).try_into()?)),
4 => Some(Header::FailTemp((sub, meta).into())),
5 => Some(Header::FailPerm((sub, meta).into())),
6 => Some(Header::CertRequired((sub, meta).into())),
impl From<Meta> for Mime {
fn from(value: Meta) -> Self {
value.0.parse().unwrap()
#[derive(Error, Debug)]
#[error("reading MIME type: {0}")]
pub struct MimeError(#[from] mime::FromStrError);
impl TryFrom<Meta> for Mime {
type Error = MimeError;
fn try_from(value: Meta) -> Result<Self, Self::Error> {
Ok(value.0.parse()?)