pub struct ResponseProtocol<TCodec>where
TCodec: RequestResponseCodec,{ /* private fields */ }Expand description
Response substream upgrade protocol.
Receives a request and sends a response.
Trait Implementations§
Source§impl<TCodec> Debug for ResponseProtocol<TCodec>
impl<TCodec> Debug for ResponseProtocol<TCodec>
Source§impl<TCodec> InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for ResponseProtocol<TCodec>where
TCodec: RequestResponseCodec + Send + 'static,
impl<TCodec> InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for ResponseProtocol<TCodec>where
TCodec: RequestResponseCodec + Send + 'static,
Source§type Output = bool
type Output = bool
Output after the upgrade has been successfully negotiated and the handshake performed.
Source§type Future = Pin<Box<dyn Future<Output = Result<<ResponseProtocol<TCodec> as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output, <ResponseProtocol<TCodec> as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<ResponseProtocol<TCodec> as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output, <ResponseProtocol<TCodec> as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error>> + Send>>
Future that performs the handshake with the remote.
Source§fn upgrade_inbound(
self,
io: NegotiatedSubstream,
protocol: Self::Info,
) -> Self::Future
fn upgrade_inbound( 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 ResponseProtocol<TCodec>where
TCodec: RequestResponseCodec,
impl<TCodec> UpgradeInfo for ResponseProtocol<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<[<ResponseProtocol<TCodec> as UpgradeInfo>::Info; 2]>
type InfoIter = IntoIter<[<ResponseProtocol<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 ResponseProtocol<TCodec>
impl<TCodec> !RefUnwindSafe for ResponseProtocol<TCodec>
impl<TCodec> Send for ResponseProtocol<TCodec>where
TCodec: Send,
impl<TCodec> Sync for ResponseProtocol<TCodec>
impl<TCodec> Unpin for ResponseProtocol<TCodec>
impl<TCodec> !UnwindSafe for ResponseProtocol<TCodec>
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<C, U> InboundUpgradeExt<C> for Uwhere
U: InboundUpgrade<C>,
impl<C, U> InboundUpgradeExt<C> for Uwhere
U: InboundUpgrade<C>,
Source§fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F>
fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F>
Returns a new object that wraps around
Self and applies a closure to the Output.Source§fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F>
fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F>
Returns a new object that wraps around
Self and applies a closure to the Error.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 more