pub struct Models<'a> { /* private fields */ }Expand description
Models API resource.
Implementations§
Source§impl Models<'_>
impl Models<'_>
Sourcepub async fn list(&self) -> Result<Vec<ModelCard>, Error>
pub async fn list(&self) -> Result<Vec<ModelCard>, Error>
List models available to the account.
A body without a models array returns Error::UnexpectedShape.
Examples found in repository?
examples/models.rs (line 28)
12async fn main() -> Result<(), Box<dyn std::error::Error>> {
13 let mock = MockServer::start().await;
14 mock.on_models().respond(json!({
15 "models": [{
16 "name": "jev-latest",
17 "description": "TypeSafe flagship",
18 "release_date": "2026-01-01"
19 }]
20 }));
21
22 let client = ClientConfig::new()
23 .api_key("test")
24 .base_url(mock.url())
25 .build()?;
26
27 client.warm_up().await?;
28 for model in client.models().list().await? {
29 println!("{} — {}", model.name, model.description);
30 }
31 Ok(())
32}Sourcepub async fn list_with(
&self,
opts: &CallOptions,
) -> Result<Vec<ModelCard>, Error>
pub async fn list_with( &self, opts: &CallOptions, ) -> Result<Vec<ModelCard>, Error>
Self::list with per-call options.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Models<'a>
impl<'a> !UnwindSafe for Models<'a>
impl<'a> Freeze for Models<'a>
impl<'a> Send for Models<'a>
impl<'a> Sync for Models<'a>
impl<'a> Unpin for Models<'a>
impl<'a> UnsafeUnpin for Models<'a>
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