pub struct ProviderId(/* private fields */);Expand description
Canonical provider identity. Eliminates string-match routing.
Known providers have predefined constants. Any string is accepted.
New built-in providers only need a constant and a behavior_for_provider entry.
Implementations§
Source§impl ProviderId
impl ProviderId
pub const OPENAI: &'static str = "openai"
pub const ANTHROPIC: &'static str = "anthropic"
pub const GOOGLE_GEMINI: &'static str = "google-gemini"
pub const OPENROUTER: &'static str = "openrouter"
pub const GITHUB_COPILOT: &'static str = "github-copilot"
pub const OPENCODE: &'static str = "opencode"
pub const OPENCODE_ZEN: &'static str = "opencode-zen"
pub const OPENCODE_GO: &'static str = "opencode-go"
pub const COMMANDCODE: &'static str = "commandcode"
pub const CHARM_HYPER: &'static str = "charm-hyper"
pub const GROQ: &'static str = "groq"
pub const XAI: &'static str = "xai"
pub const MIMO_ANTHROPIC_CN: &'static str = "mimo-anthropic-cn"
pub const MIMO_ANTHROPIC_SGP: &'static str = "mimo-anthropic-sgp"
pub const MIMO_ANTHROPIC_AMS: &'static str = "mimo-anthropic-ams"
pub const NVIDIA: &'static str = "nvidia"
Sourcepub fn from_config_id(id: &str) -> Self
pub fn from_config_id(id: &str) -> Self
Parses a provider id from the config string form (e.g. "openai",
"google-gemini"). Any string is accepted.
Sourcepub fn known(constant: &str) -> Self
pub fn known(constant: &str) -> Self
Creates a ProviderId from a known constant. Panics in debug if the
constant is not one of the predefined values (for safety).
Sourcepub fn is_opencode_family(&self) -> bool
pub fn is_opencode_family(&self) -> bool
Returns true if this provider belongs to the opencode family
(Opencode, OpencodeZen, or OpencodeGo).
Trait Implementations§
Source§impl Clone for ProviderId
impl Clone for ProviderId
Source§impl Debug for ProviderId
impl Debug for ProviderId
impl Eq for ProviderId
Source§impl PartialEq for ProviderId
impl PartialEq for ProviderId
impl StructuralPartialEq for ProviderId
Auto Trait Implementations§
impl Freeze for ProviderId
impl RefUnwindSafe for ProviderId
impl Send for ProviderId
impl Sync for ProviderId
impl Unpin for ProviderId
impl UnsafeUnpin for ProviderId
impl UnwindSafe for ProviderId
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,
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
Compare self to
key and return true if they are equal.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