Struct p2p::ReceiveRequest
source · [−]pub struct ReceiveRequest<Rq, Rs> {
pub request_id: RequestId,
pub peer: PeerId,
pub request: Rq,
pub response_tx: Sender<Rs>,
}
Expand description
Inbound Request from a remote peer.
It is expected that a response will be returned through the response_rx
channel,
otherwise an OutboundFailure
will occur at the remote peer.
Fields
request_id: RequestId
ID of the request.
peer: PeerId
ID of the remote peer that send the request.
request: Rq
Request from the remote peer.
response_tx: Sender<Rs>
Channel for returning the response.
Note: If an InboundFailure
occurs before a response was sent, the Receiver side of this channel is
dropped.
Trait Implementations
Auto Trait Implementations
impl<Rq, Rs> !RefUnwindSafe for ReceiveRequest<Rq, Rs>
impl<Rq, Rs> Send for ReceiveRequest<Rq, Rs> where
Rq: Send,
Rs: Send,
impl<Rq, Rs> Sync for ReceiveRequest<Rq, Rs> where
Rq: Sync,
Rs: Send,
impl<Rq, Rs> Unpin for ReceiveRequest<Rq, Rs> where
Rq: Unpin,
impl<Rq, Rs> !UnwindSafe for ReceiveRequest<Rq, Rs>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more