hugging_face_client/api/
get_collection.rs

1use serde::Serialize;
2
3use crate::collection::Collection;
4
5/// Request of [`crate::client::Client::get_collection`]
6#[derive(Debug, Serialize)]
7pub struct GetCollectionReq<'a> {
8  // pub(crate) namespace: &'a str,
9  pub(crate) slug: &'a str,
10  // pub(crate) id: &'a str,
11}
12
13impl<'a> GetCollectionReq<'a> {
14  // pub fn new(namespace: &'a str, slug: &'a str, id: &'a str) -> Self {
15  //   GetCollectionReq {
16  //     namespace,
17  //     slug,
18  //     id
19  //   }
20  // }
21
22  pub fn new(slug: &'a str) -> Self {
23    GetCollectionReq { slug }
24  }
25}
26
27/// Response of [`crate::client::Client::get_collection`],
28/// [`crate::client::Client::create_collection`]
29pub type GetCollectionRes = Collection;