pub struct RequestProtocol<TCodec>where
TCodec: RequestResponseCodec,{ /* private fields */ }
Expand description
Request substream upgrade protocol.
Sends a request and receives a response.
Trait Implementations§
Source§impl<TCodec> Debug for RequestProtocol<TCodec>
impl<TCodec> Debug for RequestProtocol<TCodec>
Source§impl<TCodec> OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for RequestProtocol<TCodec>where
TCodec: RequestResponseCodec + Send + 'static,
impl<TCodec> OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for RequestProtocol<TCodec>where
TCodec: RequestResponseCodec + Send + 'static,
Source§type Output = <TCodec as RequestResponseCodec>::Response
type Output = <TCodec as RequestResponseCodec>::Response
Output after the upgrade has been successfully negotiated and the handshake performed.
Source§type Future = Pin<Box<dyn Future<Output = Result<<RequestProtocol<TCodec> as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output, <RequestProtocol<TCodec> as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<RequestProtocol<TCodec> as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output, <RequestProtocol<TCodec> as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error>> + Send>>
Future that performs the handshake with the remote.
Source§fn upgrade_outbound(
self,
io: NegotiatedSubstream,
protocol: Self::Info,
) -> Self::Future
fn upgrade_outbound( self, io: NegotiatedSubstream, protocol: Self::Info, ) -> Self::Future
After we have determined that the remote supports one of the protocols we support, this
method is called to start the handshake. Read more
Source§impl<TCodec> UpgradeInfo for RequestProtocol<TCodec>where
TCodec: RequestResponseCodec,
impl<TCodec> UpgradeInfo for RequestProtocol<TCodec>where
TCodec: RequestResponseCodec,
Source§type Info = <TCodec as RequestResponseCodec>::Protocol
type Info = <TCodec as RequestResponseCodec>::Protocol
Opaque type representing a negotiable protocol.
Source§type InfoIter = IntoIter<[<RequestProtocol<TCodec> as UpgradeInfo>::Info; 2]>
type InfoIter = IntoIter<[<RequestProtocol<TCodec> as UpgradeInfo>::Info; 2]>
Iterator returned by
protocol_info
.Source§fn protocol_info(&self) -> Self::InfoIter
fn protocol_info(&self) -> Self::InfoIter
Returns the list of protocols that are supported. Used during the negotiation process.
Auto Trait Implementations§
impl<TCodec> Freeze for RequestProtocol<TCodec>where
TCodec: Freeze,
<TCodec as RequestResponseCodec>::Request: Freeze,
<TCodec as RequestResponseCodec>::Protocol: Freeze,
impl<TCodec> RefUnwindSafe for RequestProtocol<TCodec>where
TCodec: RefUnwindSafe,
<TCodec as RequestResponseCodec>::Request: RefUnwindSafe,
<TCodec as RequestResponseCodec>::Protocol: RefUnwindSafe,
impl<TCodec> Send for RequestProtocol<TCodec>where
TCodec: Send,
impl<TCodec> Sync for RequestProtocol<TCodec>where
TCodec: Sync,
<TCodec as RequestResponseCodec>::Request: Sync,
<TCodec as RequestResponseCodec>::Protocol: Sync,
impl<TCodec> Unpin for RequestProtocol<TCodec>where
TCodec: Unpin,
<TCodec as RequestResponseCodec>::Request: Unpin,
<TCodec as RequestResponseCodec>::Protocol: Unpin,
impl<TCodec> UnwindSafe for RequestProtocol<TCodec>where
TCodec: UnwindSafe,
<TCodec as RequestResponseCodec>::Request: UnwindSafe,
<TCodec as RequestResponseCodec>::Protocol: RefUnwindSafe + UnwindSafe,
Blanket Implementations§
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<C, U> OutboundUpgradeExt<C> for Uwhere
U: OutboundUpgrade<C>,
impl<C, U> OutboundUpgradeExt<C> for Uwhere
U: OutboundUpgrade<C>,
Source§fn map_outbound<F, T>(self, f: F) -> MapOutboundUpgrade<Self, F>
fn map_outbound<F, T>(self, f: F) -> MapOutboundUpgrade<Self, F>
Returns a new object that wraps around
Self
and applies a closure to the Output
.Source§fn map_outbound_err<F, T>(self, f: F) -> MapOutboundUpgradeErr<Self, F>
fn map_outbound_err<F, T>(self, f: F) -> MapOutboundUpgradeErr<Self, F>
Returns a new object that wraps around
Self
and applies a closure to the Error
.