exa_async/resources/
contents.rs1use crate::client::Client;
2use crate::config::Config;
3use crate::error::ExaError;
4use crate::types::contents::ContentsRequest;
5use crate::types::contents::ContentsResponse;
6
7pub struct Contents<'c, C: Config> {
9 client: &'c Client<C>,
10}
11
12impl<'c, C: Config> Contents<'c, C> {
13 #[must_use]
15 pub const fn new(client: &'c Client<C>) -> Self {
16 Self { client }
17 }
18
19 pub async fn create(&self, req: ContentsRequest) -> Result<ContentsResponse, ExaError> {
25 self.client.post("/contents", req).await
26 }
27}
28
29impl<C: Config> crate::Client<C> {
30 #[must_use]
32 pub const fn contents(&self) -> Contents<'_, C> {
33 Contents::new(self)
34 }
35}