pub struct RoutingControl { /* private fields */ }Expand description
Runtime routing control interface.
Allows dynamic toggling of routing, swapping fallback models, and excluding specific models at runtime.
Implementations§
Source§impl RoutingControl
impl RoutingControl
Sourcepub fn new(config: RoutingConfig) -> Self
pub fn new(config: RoutingConfig) -> Self
Create a new routing control with the given config.
Sourcepub fn set_enabled(&self, enabled: bool)
pub fn set_enabled(&self, enabled: bool)
Enable or disable routing.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether routing is currently enabled.
Sourcepub fn update_config(&self, f: impl FnOnce(&mut RoutingConfig))
pub fn update_config(&self, f: impl FnOnce(&mut RoutingConfig))
Update the routing configuration.
Sourcepub fn set_fallback_models(&self, models: Vec<String>)
pub fn set_fallback_models(&self, models: Vec<String>)
Replace the fallback model list.
Sourcepub fn exclude_model(&self, model_id: &str)
pub fn exclude_model(&self, model_id: &str)
Exclude a specific model from routing.
Sourcepub fn unexclude_model(&self, model_id: &str)
pub fn unexclude_model(&self, model_id: &str)
Remove a model from the exclusion list.
Sourcepub fn config(&self) -> RoutingConfig
pub fn config(&self) -> RoutingConfig
Get the current routing config.
Sourcepub fn fallback_models(&self) -> Vec<String>
pub fn fallback_models(&self) -> Vec<String>
Get the fallback models.
Sourcepub fn excluded_models(&self) -> Vec<String>
pub fn excluded_models(&self) -> Vec<String>
Get the excluded models.
Trait Implementations§
Source§impl Clone for RoutingControl
impl Clone for RoutingControl
Source§fn clone(&self) -> RoutingControl
fn clone(&self) -> RoutingControl
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for RoutingControl
impl !UnwindSafe for RoutingControl
impl Freeze for RoutingControl
impl Send for RoutingControl
impl Sync for RoutingControl
impl Unpin for RoutingControl
impl UnsafeUnpin for RoutingControl
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