pub struct ProxyResponse {
pub status: StatusCode,
pub headers: HeaderMap,
/* private fields */
}Expand description
Mutable view of the upstream response. v1 transforms touch status/headers and may replace the body with a small JSON value; if no replacement is set the handler streams the upstream body unchanged.
Fields§
§status: StatusCode§headers: HeaderMapImplementations§
Source§impl ProxyResponse
impl ProxyResponse
pub fn new(status: StatusCode, headers: HeaderMap) -> Self
Sourcepub fn replace_body(&mut self, value: Value)
pub fn replace_body(&mut self, value: Value)
Replace the response body with value (sent instead of streaming upstream).
pub fn replacement(&self) -> Option<&Value>
Auto Trait Implementations§
impl Freeze for ProxyResponse
impl RefUnwindSafe for ProxyResponse
impl Send for ProxyResponse
impl Sync for ProxyResponse
impl Unpin for ProxyResponse
impl UnsafeUnpin for ProxyResponse
impl UnwindSafe for ProxyResponse
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