pub enum RouterError {
BudgetExceeded {
current: f64,
attempted: f64,
limit: f64,
},
NoRoute {
task: TaskClass,
},
Json(String),
}Expand description
Errors returned by the routing core.
The core is deliberately small: the only runtime failure it can produce is
a budget rejection from crate::CostTracker::record — plus, with the
json feature enabled, pricing-table JSON load/serialization failures
from PricingTable::from_json / PricingTable::to_json.
Variants§
BudgetExceeded
A spend record was rejected because it would push total tracked cost over the configured USD budget. The tracker is left unmodified.
Fields
NoRoute
No rule and no default model can satisfy a routing request.
Json(String)
A pricing-table JSON payload could not be parsed or serialized
(feature json). The message carries the underlying serde_json
detail; the payload itself is not retained.
Trait Implementations§
Source§impl Clone for RouterError
impl Clone for RouterError
Source§impl Debug for RouterError
impl Debug for RouterError
Source§impl Display for RouterError
impl Display for RouterError
Source§impl Error for RouterError
impl Error for RouterError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for RouterError
impl PartialEq for RouterError
impl StructuralPartialEq for RouterError
Auto Trait Implementations§
impl Freeze for RouterError
impl RefUnwindSafe for RouterError
impl Send for RouterError
impl Sync for RouterError
impl Unpin for RouterError
impl UnsafeUnpin for RouterError
impl UnwindSafe for RouterError
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