pub struct BackendAppManager { /* private fields */ }Expand description
Backend application manager (adapted from rpxy backend_main.rs).
Implementations§
Source§impl BackendAppManager
impl BackendAppManager
pub fn new() -> Self
pub fn with_health_checker(self, checker: Arc<HealthChecker>) -> Self
Sourcepub fn register_upstream(&self, upstream: Upstream)
pub fn register_upstream(&self, upstream: Upstream)
Register an upstream.
Sourcepub fn register_route(
&self,
host: ServerName,
path: PathName,
upstream_id: Uuid,
)
pub fn register_route( &self, host: ServerName, path: PathName, upstream_id: Uuid, )
Register a route.
Sourcepub fn find_upstream(&self, host: &str, path: &str) -> Option<Uuid>
pub fn find_upstream(&self, host: &str, path: &str) -> Option<Uuid>
Find the best matching upstream for a request.
Sourcepub fn select_backend(
&self,
upstream_id: Uuid,
ctx: Option<&LoadBalanceContext>,
) -> Option<Backend>
pub fn select_backend( &self, upstream_id: Uuid, ctx: Option<&LoadBalanceContext>, ) -> Option<Backend>
Select a backend from an upstream, considering health status.
Sourcepub fn get_upstream(&self, id: Uuid) -> Option<Upstream>
pub fn get_upstream(&self, id: Uuid) -> Option<Upstream>
Get upstream by ID.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BackendAppManager
impl !UnwindSafe for BackendAppManager
impl Freeze for BackendAppManager
impl Send for BackendAppManager
impl Sync for BackendAppManager
impl Unpin for BackendAppManager
impl UnsafeUnpin for BackendAppManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more