pub struct HttpObjectResponse {
pub status: u16,
pub headers: Vec<(&'static str, String)>,
pub body: HttpBody,
}Expand description
A complete response. Header names are static; values never carry request text verbatim. Filenames are derived and fully percent-encoded outside RFC 5987 attr-char, with a sanitized ASCII fallback, preventing injection.
Fields§
§status: u16The status code.
headers: Vec<(&'static str, String)>Response headers.
body: HttpBodyThe body; empty for HEAD on every status.
Implementations§
Source§impl HttpObjectResponse
impl HttpObjectResponse
Sourcepub fn with_header(self, name: &'static str, value: impl Into<String>) -> Self
pub fn with_header(self, name: &'static str, value: impl Into<String>) -> Self
self with one more header.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HttpObjectResponse
impl !RefUnwindSafe for HttpObjectResponse
impl !Sync for HttpObjectResponse
impl !UnwindSafe for HttpObjectResponse
impl Send for HttpObjectResponse
impl Unpin for HttpObjectResponse
impl UnsafeUnpin for HttpObjectResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more