pub struct ResponseMut<'a> { /* private fields */ }Expand description
Mutable response wrapper for setting headers and cookies.
This is the extractor type that handlers receive. Mutations made through this wrapper are stored in request extensions and applied after the handler returns.
§Example
ⓘ
use fastapi_core::extract::ResponseMut;
async fn handler(mut resp: ResponseMut) -> &'static str {
resp.header("X-Powered-By", "fastapi-rust");
resp.cookie("visited", "true");
"Hello"
}Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ResponseMut<'a>
impl<'a> RefUnwindSafe for ResponseMut<'a>
impl<'a> Send for ResponseMut<'a>
impl<'a> Sync for ResponseMut<'a>
impl<'a> Unpin for ResponseMut<'a>
impl<'a> !UnwindSafe for ResponseMut<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).