use alloc::vec::Vec;
use url::Url;
use crate::{coroutine::HttpYield, rfc9110::response::HttpResponse};
#[derive(Clone, Debug)]
pub struct HttpSendOutput {
pub response: HttpResponse,
pub remaining: Vec<u8>,
pub keep_alive: bool,
}
#[derive(Debug)]
pub enum HttpSendYield {
WantsRead,
WantsWrite(Vec<u8>),
WantsRedirect {
url: Url,
response: HttpResponse,
keep_alive: bool,
same_origin: bool,
},
}
impl From<HttpYield> for HttpSendYield {
fn from(y: HttpYield) -> Self {
match y {
HttpYield::WantsRead => Self::WantsRead,
HttpYield::WantsWrite(bytes) => Self::WantsWrite(bytes),
}
}
}