pub enum RequestResponseCommand {
SendRequest {
peer: PeerId,
request_id: RequestId,
request: Vec<u8>,
dial_options: DialOptions,
},
SendRequestWithFallback {
peer: PeerId,
request_id: RequestId,
request: Vec<u8>,
fallback: (ProtocolName, Vec<u8>),
dial_options: DialOptions,
},
CancelRequest {
request_id: RequestId,
},
}Expand description
Request-response commands.
Variants§
SendRequest
Send request to remote peer.
Fields
§
request_id: RequestIdRequest ID.
When a response is received or the request fails, the event contains this ID that the user protocol can associate with the correct request.
If the user protocol only has one active request per peer, this ID can be safely discarded.
§
dial_options: DialOptionsDial options, see DialOptions for more details.
SendRequestWithFallback
Fields
§
fallback: (ProtocolName, Vec<u8>)Request that is sent over the fallback protocol, if negotiated.
§
dial_options: DialOptionsDial options, see DialOptions for more details.
CancelRequest
Cancel outbound request.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RequestResponseCommand
impl RefUnwindSafe for RequestResponseCommand
impl Send for RequestResponseCommand
impl Sync for RequestResponseCommand
impl Unpin for RequestResponseCommand
impl UnwindSafe for RequestResponseCommand
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more