pub struct RouteDirective {
pub provider: String,
pub model: String,
pub action: Option<String>,
pub is_free: bool,
}Expand description
Routing directive specifying which LLM provider and model to use.
Fields§
§provider: StringLLM provider name (e.g. "anthropic", "openrouter").
model: StringModel identifier within the provider (e.g. "claude-sonnet-4-5").
action: Option<String>CLI action template with {{ model }} and {{ prompt }} placeholders.
is_free: boolWhether this model is free (zero cost).
Implementations§
Source§impl RouteDirective
impl RouteDirective
Sourcepub fn cli_basename(&self) -> Option<&str>
pub fn cli_basename(&self) -> Option<&str>
Extract the CLI basename from the first whitespace-delimited token of
the action template, e.g. "opencode" from
"/home/alex/.bun/bin/opencode run -m {{ model }} ...".
Returns None when the action template is missing or empty.
Sourcepub fn route_key(&self) -> String
pub fn route_key(&self) -> String
Build a probe/health cache key from the route’s (cli, provider, model)
triple. Used so that the same (provider, model) reached via two
different CLIs (e.g. opencode vs. pi-rust) has independent health.
Returns an empty CLI segment when the action template is missing.
Trait Implementations§
Source§impl Clone for RouteDirective
impl Clone for RouteDirective
Source§fn clone(&self) -> RouteDirective
fn clone(&self) -> RouteDirective
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RouteDirective
impl Debug for RouteDirective
Source§impl<'de> Deserialize<'de> for RouteDirective
impl<'de> Deserialize<'de> for RouteDirective
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RouteDirective
Source§impl PartialEq for RouteDirective
impl PartialEq for RouteDirective
Source§impl Serialize for RouteDirective
impl Serialize for RouteDirective
impl StructuralPartialEq for RouteDirective
Auto Trait Implementations§
impl Freeze for RouteDirective
impl RefUnwindSafe for RouteDirective
impl Send for RouteDirective
impl Sync for RouteDirective
impl Unpin for RouteDirective
impl UnsafeUnpin for RouteDirective
impl UnwindSafe for RouteDirective
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
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.