pub struct HeaderInjectLayer { /* private fields */ }Expand description
Applies header rules to requests and/or responses.
Implementations§
Source§impl HeaderInjectLayer
impl HeaderInjectLayer
pub fn new() -> Self
Sourcepub fn request_rule(self, rule: HeaderRule) -> Self
pub fn request_rule(self, rule: HeaderRule) -> Self
Add a rule applied to requests.
Sourcepub fn response_rule(self, rule: HeaderRule) -> Self
pub fn response_rule(self, rule: HeaderRule) -> Self
Add a rule applied to responses.
Sourcepub fn set_request_header(self, name: HeaderName, value: HeaderValue) -> Self
pub fn set_request_header(self, name: HeaderName, value: HeaderValue) -> Self
Set a request header.
Sourcepub fn remove_request_header(self, name: HeaderName) -> Self
pub fn remove_request_header(self, name: HeaderName) -> Self
Remove a request header.
Sourcepub fn set_response_header(self, name: HeaderName, value: HeaderValue) -> Self
pub fn set_response_header(self, name: HeaderName, value: HeaderValue) -> Self
Set a response header.
Trait Implementations§
Source§impl Default for HeaderInjectLayer
impl Default for HeaderInjectLayer
Source§impl ProxyLayer for HeaderInjectLayer
impl ProxyLayer for HeaderInjectLayer
Source§fn on_request<'life0, 'async_trait>(
&'life0 self,
request: ProxyRequest,
) -> Pin<Box<dyn Future<Output = ProxyResult<LayerAction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_request<'life0, 'async_trait>(
&'life0 self,
request: ProxyRequest,
) -> Pin<Box<dyn Future<Output = ProxyResult<LayerAction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process an incoming request. Return
Forward to pass it on,
or Respond to short-circuit with an immediate response.Source§fn on_response<'life0, 'async_trait>(
&'life0 self,
response: ProxyResponse,
) -> Pin<Box<dyn Future<Output = ProxyResult<ProxyResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_response<'life0, 'async_trait>(
&'life0 self,
response: ProxyResponse,
) -> Pin<Box<dyn Future<Output = ProxyResult<ProxyResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process a response before it’s sent back to the client.
Called in reverse layer order.
Auto Trait Implementations§
impl Freeze for HeaderInjectLayer
impl RefUnwindSafe for HeaderInjectLayer
impl Send for HeaderInjectLayer
impl Sync for HeaderInjectLayer
impl Unpin for HeaderInjectLayer
impl UnsafeUnpin for HeaderInjectLayer
impl UnwindSafe for HeaderInjectLayer
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