pub struct ModelsDevPayload(/* private fields */);Expand description
Top-level response payload from the models.dev API: a provider-keyed map.
Breaking change: this was previously { models: Vec<ModelEntry> }, a
shape that never matched the live API. The real response is a map of
provider id → provider object; this type now mirrors it. The on-disk cache
written by fetch_and_cache is byte-identical to the upstream payload.
Implementations§
Source§impl ModelsDevPayload
impl ModelsDevPayload
Sourcepub fn entries(&self) -> Vec<ModelEntry>
pub fn entries(&self) -> Vec<ModelEntry>
Flatten every provider into discovery ModelEntry records, in
deterministic (sorted provider id, sorted model id) order.
Sourcepub fn provider_models(&self, provider_key: &str) -> Vec<ModelDescriptor>
pub fn provider_models(&self, provider_key: &str) -> Vec<ModelDescriptor>
Return the catalog model descriptors for one upstream provider key, in sorted model-id order. Returns an empty vec if the key is absent.
Sourcepub fn provider_api_base(&self, provider_key: &str) -> Option<&str>
pub fn provider_api_base(&self, provider_key: &str) -> Option<&str>
Return the upstream provider’s api base URL, if advertised.
Sourcepub fn provider_npm(&self, provider_key: &str) -> Option<&str>
pub fn provider_npm(&self, provider_key: &str) -> Option<&str>
Return the upstream provider’s npm package name, if any.
Sourcepub fn provider_doc(&self, provider_key: &str) -> Option<&str>
pub fn provider_doc(&self, provider_key: &str) -> Option<&str>
Return the upstream provider’s documentation URL, if any.
Trait Implementations§
Source§impl Clone for ModelsDevPayload
impl Clone for ModelsDevPayload
Source§fn clone(&self) -> ModelsDevPayload
fn clone(&self) -> ModelsDevPayload
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 ModelsDevPayload
impl Debug for ModelsDevPayload
Source§impl<'de> Deserialize<'de> for ModelsDevPayload
impl<'de> Deserialize<'de> for ModelsDevPayload
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>,
Auto Trait Implementations§
impl Freeze for ModelsDevPayload
impl RefUnwindSafe for ModelsDevPayload
impl Send for ModelsDevPayload
impl Sync for ModelsDevPayload
impl Unpin for ModelsDevPayload
impl UnsafeUnpin for ModelsDevPayload
impl UnwindSafe for ModelsDevPayload
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>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.