pub enum Route {
Deny,
ClusterId(ClusterId),
Frontend(Rc<Frontend>),
}Expand description
What to do with a request that matches a frontend.
Three variants coexist today; the legacy two will retire once
HttpFrontend itself carries the rich routing fields:
Route::ClusterIdis the legacy “forward to this cluster” variant used by call sites that build routes directly fromHttpFrontend::cluster_id.Route::Denyis the legacy “send 401” variant used when a frontend has nocluster_id.Route::Frontendcarries a richerFrontenddecision (redirect policy, rewrite templates, header edits, auth gating). OnceHttpFrontendcarries the matching proto fields,add_http_frontwill buildRoute::Frontenddirectly and the two legacy variants above can retire.
Eq/PartialEq compare Frontend variants by Rc pointer identity to
stay consistent with Hash/Ord on Rc; this is sufficient for the
router’s de-duplication (add_pre_rule, add_post_rule,
add_tree_rule) which only checks against routes created from the same
configuration call.
Variants§
Deny
send a 401 default answer
ClusterId(ClusterId)
the cluster to which the frontend belongs
Frontend(Rc<Frontend>)
rich routing decision carrying redirect, rewrite, header, and auth
configuration; supersedes the two legacy variants once the
in-memory frontend wiring is migrated to build Route::Frontend
directly.
Trait Implementations§
impl Eq for Route
Source§impl Ord for Route
impl Ord for Route
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Route
impl PartialOrd for Route
impl StructuralPartialEq for Route
Auto Trait Implementations§
impl !Send for Route
impl !Sync for Route
impl Freeze for Route
impl RefUnwindSafe for Route
impl Unpin for Route
impl UnsafeUnpin for Route
impl UnwindSafe for Route
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.