pub struct AuthProvider {
pub account_id: String,
}Expand description
Workers AI auth-provider endpoints for one account.
Exactly one source of truth for every URL the plugin and the crates build.
Fields§
§account_id: StringImplementations§
Source§impl AuthProvider
impl AuthProvider
Sourcepub fn new(account_id: impl Into<String>) -> Self
pub fn new(account_id: impl Into<String>) -> Self
Build the provider from an account ID (lenient - used by the Python profile, which handles the missing-env case itself).
Sourcepub fn from_env_lenient() -> Option<Self>
pub fn from_env_lenient() -> Option<Self>
Build the provider from environment credentials, if present.
Sourcepub fn base_url(&self) -> String
pub fn base_url(&self) -> String
OpenAI-compatible inference base URL - hermes appends
/chat/completions in Chat Completions mode.
Sourcepub fn models_url(&self) -> String
pub fn models_url(&self) -> String
Model catalog endpoint (OpenRouter-compatible response shape).
Sourcepub fn verify_url(&self) -> String
pub fn verify_url(&self) -> String
Token verification endpoint - the plugin’s health check.
Sourcepub fn run_url(&self, model: &str) -> String
pub fn run_url(&self, model: &str) -> String
Native (REST-style) model invocation path - kept for parity with the user’s existing curl workflow, NOT used by the OpenAI-compatible wire.
Sourcepub fn cache_slug(&self) -> String
pub fn cache_slug(&self) -> String
Account-scoped cache directory name (first 12 hex of sha256).
Trait Implementations§
Source§impl Clone for AuthProvider
impl Clone for AuthProvider
Source§fn clone(&self) -> AuthProvider
fn clone(&self) -> AuthProvider
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 AuthProvider
impl Debug for AuthProvider
impl Eq for AuthProvider
Source§impl PartialEq for AuthProvider
impl PartialEq for AuthProvider
impl StructuralPartialEq for AuthProvider
Auto Trait Implementations§
impl Freeze for AuthProvider
impl RefUnwindSafe for AuthProvider
impl Send for AuthProvider
impl Sync for AuthProvider
impl Unpin for AuthProvider
impl UnsafeUnpin for AuthProvider
impl UnwindSafe for AuthProvider
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
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§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.