pub struct MutableRequest<T>{
pub parts: Parts,
pub body: T,
}Expand description
Represents an HTTP request (from hyper) with helpers for mutating it.
Fields§
§parts: Parts§body: TImplementations§
Source§impl<T> MutableRequest<T>
impl<T> MutableRequest<T>
pub fn from_request(request: Request<T>) -> Self
pub fn into_request(self) -> Request<T>
pub fn into_request_with_simple_body(self) -> Request<SimpleBody>
Sourcepub fn set_upstream_address(&mut self, address: SocketAddr)
pub fn set_upstream_address(&mut self, address: SocketAddr)
Rewrite the request so that it points to the given upstream address.
Sourcepub fn add_header(&mut self, key: &str, value: &str)
pub fn add_header(&mut self, key: &str, value: &str)
Add a header to the request.
If the header is invalid, it will be ignored and logged.
pub fn headers_mut(&mut self) -> &mut HeaderMap
Auto Trait Implementations§
impl<T> !Freeze for MutableRequest<T>
impl<T> !RefUnwindSafe for MutableRequest<T>
impl<T> Send for MutableRequest<T>
impl<T> Sync for MutableRequest<T>
impl<T> Unpin for MutableRequest<T>
impl<T> !UnwindSafe for MutableRequest<T>
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