use alloc::vec::Vec;
use io_http::rfc9110::send::HttpSendYield;
use url::Url;
#[derive(Debug)]
pub enum JmapRedirectYield {
WantsRead,
WantsWrite(Vec<u8>),
WantsRedirect {
url: Url,
keep_alive: bool,
same_origin: bool,
},
}
impl From<HttpSendYield> for JmapRedirectYield {
fn from(y: HttpSendYield) -> Self {
match y {
HttpSendYield::WantsRead => Self::WantsRead,
HttpSendYield::WantsWrite(bytes) => Self::WantsWrite(bytes),
HttpSendYield::WantsRedirect {
url,
keep_alive,
same_origin,
..
} => Self::WantsRedirect {
url,
keep_alive,
same_origin,
},
}
}
}