WIZUYIA53JTFD6RXK3VMTSC654QIKRLZZYYEPN2I3TFVGY3FPQ3AC
W6L422WPVB6BD5L42EBUQX5CS2ZN5KBLIOFPAGUNA37PYPLP2GAAC
EKHEIJTI5NI3I5IIC5IIBC7XIAOCQ6PXV5WN5AXW3FIVDKPTG3NQC
2C4IMVXFZ2JTPWLBFQAY5SVVOJD6AUECPBMZ2UEMU3BBXFDLMS4AC
3SPNKI46URBW4PD3JRMBV5YV5W56N3SFUTK25VQEF2FUZ64ZDQPAC
H7P2HPKXGMYH55QHYWRLZ65EBNGLNBERDGY2TZLAR4C74QDMJW3AC
WGRFJRTEXOKY7PV536O62WUE32T24VQEHFQP67GEZZ67AE37ZWUAC
ONQEIR5BV26QJSI3HY7B3MN6VWEGSZIXAIUIANJ5ZLR3QN3DFGEAC
3VVQWLOXWDG4PFA3GCR4QFRKHHNZGK52KWMPAOSDN734DABSJZVQC
impl TryFrom<(u8, Meta)> for Success {
type Error = super::MimeError;
fn try_from((_, meta): (u8, Meta)) -> Result<Self, Self::Error> {
let mime = Mime::try_from(meta)?;
Ok(Self { mime })
impl From<(u8, Meta)> for Success {
fn from((_, meta): (u8, Meta)) -> Self {
let mime = Mime::try_from(Meta::try_from(meta).unwrap()).expect("failed to read mime");
Self { mime }
#[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> {
impl From<(u8, Meta)> for Redirect {
fn from((code, meta): (u8, Meta)) -> Self {
#[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()?)
impl From<Meta> for Mime {
fn from(value: Meta) -> Self {
value.0.parse().unwrap()
}
impl RaiseTo<String> for Line<'_> {
type Output<'a> = Line<'a>;
fn raise_to<'a>(&self, target: &'a mut String) -> Self::Output<'a> {
match self {
Line::Heading { level, title } => Line::Heading {
level: *level,
title: title.raise_to(target),
},
Line::Link { url, description } => {
let url = url.raise_to(target);
let description = description.map(|d| d.raise_to(target));
Line::Link { url, description }
}
Line::Text(t) => Line::Text(t.raise_to(target)),
Line::Preformatted(p) => Line::Preformatted(p.raise_to(target)),
Line::ListItem(li) => Line::ListItem(li.raise_to(target)),
Line::Quote(q) => Line::Quote(q.raise_to(target)),
}
}
/// Trust on first use
pub struct Tofu {
known_hosts: Vec<TofuHost>,
}
pub struct TofuHost {}
/*
impl rustls::client::ServerCertVerifier for Tofu {
fn verify_server_cert(
&self,
end_entity: &Certificate,
_: &[Certificate],
server_name: &ServerName,
scts: &mut dyn Iterator<Item = &[u8]>,
ocsp_response: &[u8],
now: SystemTime,
) -> Result<ServerCertVerified, Error> {
let host: TofuHost = TofuHost::new();
if self.knows(host) {
if self.trusts(host) {
Ok(())
} else {
Err(())
}
} else {
self.remember(host);
Ok(())
}
}
}
*/