pub struct Response {
pub(crate) headers: HashMap<String, String>,
pub(crate) status_code: u16,
pub(crate) body: Vec<u8>,
pub(crate) handled: bool,
}Fields§
§headers: HashMap<String, String>§status_code: u16§body: Vec<u8>§handled: boolImplementations§
Source§impl Response
impl Response
pub fn add_header<H: Into<String>, V: Into<String>>( &mut self, header: H, value: V, )
pub fn set_status(&mut self, code: u16)
pub fn set_body(&mut self, body: Vec<u8>)
Sourcepub fn set_handled(&mut self, handled: bool)
pub fn set_handled(&mut self, handled: bool)
Mark as handled — the plugin will send this response instead of looking up a static asset. Use for proxy routes, health checks, etc.
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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