We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Deref<Target=hyper::Response>
Response
1 parent 1e66a57 commit ca02f58Copy full SHA for ca02f58
src/tests/util/response.rs
@@ -3,6 +3,7 @@ use bytes::Bytes;
3
use googletest::prelude::*;
4
use serde_json::Value;
5
use std::marker::PhantomData;
6
+use std::ops::Deref;
7
use std::str::from_utf8;
8
9
use crates_io::rate_limiter::LimitedAction;
@@ -15,6 +16,14 @@ pub struct Response<T> {
15
16
return_type: PhantomData<T>,
17
}
18
19
+impl Deref for Response<()> {
20
+ type Target = hyper::Response<Bytes>;
21
+
22
+ fn deref(&self) -> &Self::Target {
23
+ &self.response
24
+ }
25
+}
26
27
impl<T> Response<T>
28
where
29
for<'de> T: serde::Deserialize<'de>,
0 commit comments