hugging_face_client/api/
get_model.rs

1use serde::Serialize;
2
3use crate::model::Model;
4
5/// Request of [`crate::client::Client::get_model`]
6#[derive(Debug, Serialize)]
7pub struct GetModelReq<'a> {
8  #[serde(rename = "repo_id")]
9  pub(crate) repo_name: &'a str,
10
11  #[serde(skip_serializing_if = "Option::is_none")]
12  pub(crate) revision: Option<&'a str>,
13}
14
15impl<'a> GetModelReq<'a> {
16  pub fn new(repo_name: &str) -> GetModelReq<'_> {
17    GetModelReq {
18      repo_name,
19      revision: None,
20    }
21  }
22
23  pub fn revision(mut self, revision: &'a str) -> Self {
24    self.revision = Some(revision);
25    self
26  }
27}
28
29/// Response of [`crate::client::Client::get_model`]
30pub type GetModelRes = Model;