pub struct TemplateTarget { /* private fields */ }Expand description
A template-based target resolver that substitutes path parameters into a URL template.
Template placeholders use the format {param_name} and are replaced with the
corresponding path parameter values from the request.
§Example
use axum::Router;
use axum_reverse_proxy::{ProxyRouterExt, proxy_template};
let app: Router = Router::new()
// Request to /videos/abc123/720p proxies to https://cdn.example.com/v/abc123/res_720p
.proxy_route("/videos/{id}/{quality}", proxy_template("https://cdn.example.com/v/{id}/res_{quality}"));Implementations§
Trait Implementations§
Source§impl Clone for TemplateTarget
impl Clone for TemplateTarget
Source§fn clone(&self) -> TemplateTarget
fn clone(&self) -> TemplateTarget
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TemplateTarget
impl RefUnwindSafe for TemplateTarget
impl Send for TemplateTarget
impl Sync for TemplateTarget
impl Unpin for TemplateTarget
impl UnwindSafe for TemplateTarget
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