exa_async/resources/
answer.rs1use crate::client::Client;
2use crate::config::Config;
3use crate::error::ExaError;
4use crate::types::answer::AnswerRequest;
5use crate::types::answer::AnswerResponse;
6
7pub struct Answer<'c, C: Config> {
9 client: &'c Client<C>,
10}
11
12impl<'c, C: Config> Answer<'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: AnswerRequest) -> Result<AnswerResponse, ExaError> {
25 self.client.post("/answer", req).await
26 }
27}
28
29impl<C: Config> crate::Client<C> {
30 #[must_use]
32 pub const fn answer(&self) -> Answer<'_, C> {
33 Answer::new(self)
34 }
35}