pub enum RoutingDecision {
Local {
score: f64,
worker: WorkerKind,
},
LocalWithFallback {
score: f64,
primary: WorkerKind,
fallback: WorkerKind,
},
Cloud {
score: f64,
worker: WorkerKind,
},
}Expand description
Variants§
Local
Route to the local model (complexity below local_threshold).
Fields
§
worker: WorkerKindThe worker kind selected.
LocalWithFallback
Route to the local model first, fall back to cloud on failure
(complexity between local_threshold and cloud_threshold).
Cloud
Route directly to the cloud model (complexity above cloud_threshold).
Fields
§
worker: WorkerKindThe worker kind selected.
Implementations§
Source§impl RoutingDecision
impl RoutingDecision
Sourcepub fn is_local(&self) -> bool
pub fn is_local(&self) -> bool
Return true if the decision routes to the local worker exclusively.
§Panics
This function never panics.
Sourcepub fn is_cloud(&self) -> bool
pub fn is_cloud(&self) -> bool
Return true if the decision routes to the cloud worker exclusively.
§Panics
This function never panics.
Sourcepub fn is_fallback(&self) -> bool
pub fn is_fallback(&self) -> bool
Trait Implementations§
Source§impl Clone for RoutingDecision
impl Clone for RoutingDecision
Source§fn clone(&self) -> RoutingDecision
fn clone(&self) -> RoutingDecision
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RoutingDecision
impl Debug for RoutingDecision
Source§impl PartialEq for RoutingDecision
impl PartialEq for RoutingDecision
Source§fn eq(&self, other: &RoutingDecision) -> bool
fn eq(&self, other: &RoutingDecision) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RoutingDecision
Auto Trait Implementations§
impl Freeze for RoutingDecision
impl RefUnwindSafe for RoutingDecision
impl Send for RoutingDecision
impl Sync for RoutingDecision
impl Unpin for RoutingDecision
impl UnsafeUnpin for RoutingDecision
impl UnwindSafe for RoutingDecision
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request