B:BD[
2.11542] → [
2.11542:11650]
pub fn with_body(header: Header, body: Vec<u8>) -> Option<Self> {
Self::new(header, Some(body))
pub fn with_body(mime_type: String, body: Vec<u8>) -> Option<Self> {
let header = Header::new(Status::SUCCESS, mime_type)?;
let body = Some(body);
Some(Response { header, body })
}
/// Construct a new response with a gemtext body.
pub fn with_gemtext(builder: Builder) -> Self {
let header = Header::gemtext();
let body = Some(builder.build().bytes().collect());
Self::new_unchecked(header, body)