We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
new(Address)
1 parent 14d3df7 commit b8a2ecaCopy full SHA for b8a2eca
āsrc/responder/request.rs
@@ -27,6 +27,20 @@ impl Request {
27
&self.addresses
28
}
29
30
+ /// Create a new request for this address.
31
+ ///
32
+ /// Returns a receiver for the response to this request, as well as the request itself.
33
+ pub fn new(address: Address) -> (oneshot::Receiver<Response>, Self) {
34
+ let (tx, rx) = oneshot::channel();
35
+ let addresses = vec![AddressOrAlmost::Address(Box::new(address))];
36
+ let req = Self {
37
+ addresses,
38
+ response: tx,
39
+ };
40
+
41
+ (rx, req)
42
+ }
43
44
/// Create a new request by scanning the contents of a [`Message`].
45
///
46
/// Returns a receiver for the response to this request, as well as the request itself.
0 commit comments