pub struct Route {
pub upstream_name: String,
pub strip_prefix: bool,
pub rewrite: Option<String>,
/* private fields */
}Expand description
Route matching and upstream selection
Fields§
§upstream_name: StringTarget upstream name
strip_prefix: boolStrip the matched prefix before forwarding
rewrite: Option<String>Rewrite the path
Implementations§
Source§impl Route
impl Route
Sourcepub fn from_config(config: &RouteConfig) -> Result<Self>
pub fn from_config(config: &RouteConfig) -> Result<Self>
Create route from TOML configuration
Sourcepub fn matches(&self, session: &Session) -> bool
pub fn matches(&self, session: &Session) -> bool
Check if this route matches the incoming request
Sourcepub fn transform_path(&self, original: &str) -> String
pub fn transform_path(&self, original: &str) -> String
Transform the path according to route configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Route
impl RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnwindSafe for Route
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