Struct kvarn_extensions::reverse_proxy::Manager
source · [−]pub struct Manager { /* private fields */ }
Available on crate feature
reverse-proxy
only.Implementations
sourceimpl Manager
impl Manager
sourcepub fn new(
when: If,
connection: GetConnectionFn,
modify: ModifyRequestFn,
timeout: Duration
) -> Self
pub fn new(
when: If,
connection: GetConnectionFn,
modify: ModifyRequestFn,
timeout: Duration
) -> Self
Consider using static_connection
if your connection type is not dependent of the request.
sourcepub fn disable_url_rewrite(self) -> Self
pub fn disable_url_rewrite(self) -> Self
Disables the built-in feature of rewriting the relative URLs so they point to the forwarded site.
sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Set the priority of the extension. The default is -128
.
sourcepub fn add_modify_fn(self, modify: ModifyRequestFn) -> Self
pub fn add_modify_fn(self, modify: ModifyRequestFn) -> Self
Add a function to run before the request is sent. These are ran in the order they are added in.
sourcepub fn with_x_real_ip(self) -> Self
pub fn with_x_real_ip(self) -> Self
Add a modify fn which adds the IP of the request as the header
x-real-ip
.
sourcepub fn base(
base_path: &str,
connection: GetConnectionFn,
timeout: Duration
) -> Self
pub fn base(
base_path: &str,
connection: GetConnectionFn,
timeout: Duration
) -> Self
Consider using static_connection
if your connection type is not dependent of the request.
sourcepub fn mount(self, extensions: &mut Extensions)
pub fn mount(self, extensions: &mut Extensions)
Attach this reverse proxy to extensions
.
Auto Trait Implementations
impl !RefUnwindSafe for Manager
impl Send for Manager
impl Sync for Manager
impl Unpin for Manager
impl !UnwindSafe for Manager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more