pub struct Router {
pub backends: BackendConnections,
pub configured_backend_timeout: Duration,
pub configured_connect_timeout: Duration,
/* private fields */
}Fields§
§backends: BackendConnections§configured_backend_timeout: Duration§configured_connect_timeout: DurationImplementations§
Source§impl Router
impl Router
pub fn new( configured_backend_timeout: Duration, configured_connect_timeout: Duration, ) -> Self
Sourcepub fn backend_from_request(
&mut self,
cluster_id: &str,
frontend_should_stick: bool,
context: &mut HttpContext,
selector: &mut dyn BackendSelector,
) -> Result<BackendId, BackendConnectionError>
pub fn backend_from_request( &mut self, cluster_id: &str, frontend_should_stick: bool, context: &mut HttpContext, selector: &mut dyn BackendSelector, ) -> Result<BackendId, BackendConnectionError>
Pick the backend for an already-routed request and stamp its identity
onto the request’s HttpContext.
Takes no listener handle: every listener-derived value this needs —
sticky_name above all — is already on the HttpContext that
Context::create_stream filled when the request arrived, and reading
the listener again here would be exactly the mid-request reload leak
LIFECYCLE.md §2.5 rules out.
Takes no proxy handle either: the backend set arrives as selector, a
capability borrowed for this one call (see BackendSelector).
Returns the chosen backend, reserved but not dialled: the caller
connects to BackendId::address (#1684).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Router
impl !RefUnwindSafe for Router
impl !Send for Router
impl !Sync for Router
impl !UnwindSafe for Router
impl Unpin for Router
impl UnsafeUnpin for Router
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