next_web_ai/chat/client/
response_entity.rs

1#[derive(Clone, serde::Deserialize)]
2pub struct ResponseEntity<R, E> {
3    pub(crate) response: R,
4    pub(crate) entity: Option<E>,
5}
6
7impl<R, E> ResponseEntity<R, E> {
8    pub fn new(response: R, entity: Option<E>) -> ResponseEntity<R, E> {
9        Self { response, entity }
10    }
11
12    pub fn response(&self) -> &R {
13        &self.response
14    }
15
16    pub fn entity(&self) -> &Option<E> {
17        &self.entity
18    }
19}