pub struct ServerResponse {
pub status: Option<HttpStatusCode>,
pub headers: Vec<(String, String)>,
pub body: Option<Vec<u8>>,
}
Expand description
The response made from the server.
Note that the response could be partial and composable.
Fields§
§status: Option<HttpStatusCode>
The status code of the response.
headers: Vec<(String, String)>
The headers of the response.
body: Option<Vec<u8>>
The body of the response.
Implementations§
Source§impl ServerResponse
impl ServerResponse
Sourcepub fn then(self, other: ServerResponse) -> ServerResponse
pub fn then(self, other: ServerResponse) -> ServerResponse
Compose with next response. If self is having the body, the next response will be ignored.
Auto Trait Implementations§
impl Freeze for ServerResponse
impl RefUnwindSafe for ServerResponse
impl Send for ServerResponse
impl Sync for ServerResponse
impl Unpin for ServerResponse
impl UnwindSafe for ServerResponse
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