twizzler_driver/request/
response_info.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
2pub struct ResponseInfo<R> {
4 resp: R,
5 is_err: bool,
6 id: u64,
7}
8
9impl<R: Send> ResponseInfo<R> {
10 pub fn new(resp: R, id: u64, is_err: bool) -> Self {
12 Self { resp, is_err, id }
13 }
14
15 pub fn is_err(&self) -> bool {
17 self.is_err
18 }
19
20 pub fn data(&self) -> &R {
22 &self.resp
23 }
24
25 pub fn into_inner(self) -> R {
27 self.resp
28 }
29
30 pub fn id(&self) -> u64 {
32 self.id
33 }
34}