pub struct CompositePolicy { /* private fields */ }Expand description
Combines multiple policies with weighted scoring
Implementations§
Source§impl CompositePolicy
impl CompositePolicy
pub fn new() -> Self
pub fn with_policy(self, policy: impl RoutingPolicyTrait + 'static) -> Self
Sourcepub fn enterprise_default() -> Self
pub fn enterprise_default() -> Self
Create default enterprise policy
Trait Implementations§
Source§impl Default for CompositePolicy
impl Default for CompositePolicy
Source§impl RoutingPolicyTrait for CompositePolicy
impl RoutingPolicyTrait for CompositePolicy
Source§fn score(&self, candidate: &RouteCandidate, request: &InferenceRequest) -> f64
fn score(&self, candidate: &RouteCandidate, request: &InferenceRequest) -> f64
Score a candidate node (higher = better)
Source§fn is_eligible(
&self,
candidate: &RouteCandidate,
request: &InferenceRequest,
) -> bool
fn is_eligible( &self, candidate: &RouteCandidate, request: &InferenceRequest, ) -> bool
Check if a candidate is eligible
Auto Trait Implementations§
impl Freeze for CompositePolicy
impl !RefUnwindSafe for CompositePolicy
impl Send for CompositePolicy
impl Sync for CompositePolicy
impl Unpin for CompositePolicy
impl !UnwindSafe for CompositePolicy
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
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