pub struct SimpleProtocolUpgrade<TInfo> { /* private fields */ }Expand description
A simple ProtocolUpgrade implementation that just
returns the socket and the protocol upgrade infos
Implementations§
Source§impl<TInfo> SimpleProtocolUpgrade<TInfo>
impl<TInfo> SimpleProtocolUpgrade<TInfo>
pub fn new(protocol_info: TInfo) -> SimpleProtocolUpgrade<TInfo>
Trait Implementations§
Source§impl<TInfo> Clone for SimpleProtocolUpgrade<TInfo>where
TInfo: Clone,
impl<TInfo> Clone for SimpleProtocolUpgrade<TInfo>where
TInfo: Clone,
Source§fn clone(&self) -> SimpleProtocolUpgrade<TInfo>
fn clone(&self) -> SimpleProtocolUpgrade<TInfo>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<TInfo> Debug for SimpleProtocolUpgrade<TInfo>where
TInfo: Debug,
impl<TInfo> Debug for SimpleProtocolUpgrade<TInfo>where
TInfo: Debug,
Source§impl<TInfo> InboundUpgrade<Stream> for SimpleProtocolUpgrade<TInfo>
impl<TInfo> InboundUpgrade<Stream> for SimpleProtocolUpgrade<TInfo>
Source§type Output = ProtocolUpgradeOutput<TInfo>
type Output = ProtocolUpgradeOutput<TInfo>
Output after the upgrade has been successfully negotiated and the handshake performed.
Source§type Error = Infallible
type Error = Infallible
Possible error during the handshake.
Source§type Future = Ready<Result<<SimpleProtocolUpgrade<TInfo> as InboundUpgrade<Stream>>::Output, <SimpleProtocolUpgrade<TInfo> as InboundUpgrade<Stream>>::Error>>
type Future = Ready<Result<<SimpleProtocolUpgrade<TInfo> as InboundUpgrade<Stream>>::Output, <SimpleProtocolUpgrade<TInfo> as InboundUpgrade<Stream>>::Error>>
Future that performs the handshake with the remote.
Source§fn upgrade_inbound(
self,
socket: Stream,
info: <SimpleProtocolUpgrade<TInfo> as UpgradeInfo>::Info,
) -> <SimpleProtocolUpgrade<TInfo> as InboundUpgrade<Stream>>::Future
fn upgrade_inbound( self, socket: Stream, info: <SimpleProtocolUpgrade<TInfo> as UpgradeInfo>::Info, ) -> <SimpleProtocolUpgrade<TInfo> as InboundUpgrade<Stream>>::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<TInfo> OutboundUpgrade<Stream> for SimpleProtocolUpgrade<TInfo>
impl<TInfo> OutboundUpgrade<Stream> for SimpleProtocolUpgrade<TInfo>
Source§type Output = ProtocolUpgradeOutput<TInfo>
type Output = ProtocolUpgradeOutput<TInfo>
Output after the upgrade has been successfully negotiated and the handshake performed.
Source§type Error = Infallible
type Error = Infallible
Possible error during the handshake.
Source§type Future = Ready<Result<<SimpleProtocolUpgrade<TInfo> as OutboundUpgrade<Stream>>::Output, <SimpleProtocolUpgrade<TInfo> as OutboundUpgrade<Stream>>::Error>>
type Future = Ready<Result<<SimpleProtocolUpgrade<TInfo> as OutboundUpgrade<Stream>>::Output, <SimpleProtocolUpgrade<TInfo> as OutboundUpgrade<Stream>>::Error>>
Future that performs the handshake with the remote.
Source§fn upgrade_outbound(
self,
socket: Stream,
info: <SimpleProtocolUpgrade<TInfo> as UpgradeInfo>::Info,
) -> <SimpleProtocolUpgrade<TInfo> as OutboundUpgrade<Stream>>::Future
fn upgrade_outbound( self, socket: Stream, info: <SimpleProtocolUpgrade<TInfo> as UpgradeInfo>::Info, ) -> <SimpleProtocolUpgrade<TInfo> as OutboundUpgrade<Stream>>::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<TInfo> UpgradeInfo for SimpleProtocolUpgrade<TInfo>
impl<TInfo> UpgradeInfo for SimpleProtocolUpgrade<TInfo>
Source§type InfoIter = Once<<SimpleProtocolUpgrade<TInfo> as UpgradeInfo>::Info>
type InfoIter = Once<<SimpleProtocolUpgrade<TInfo> as UpgradeInfo>::Info>
Iterator returned by
protocol_info.Source§fn protocol_info(
&self,
) -> <SimpleProtocolUpgrade<TInfo> as UpgradeInfo>::InfoIter
fn protocol_info( &self, ) -> <SimpleProtocolUpgrade<TInfo> as UpgradeInfo>::InfoIter
Returns the list of protocols that are supported. Used during the negotiation process.
Auto Trait Implementations§
impl<TInfo> Freeze for SimpleProtocolUpgrade<TInfo>where
TInfo: Freeze,
impl<TInfo> RefUnwindSafe for SimpleProtocolUpgrade<TInfo>where
TInfo: RefUnwindSafe,
impl<TInfo> Send for SimpleProtocolUpgrade<TInfo>where
TInfo: Send,
impl<TInfo> Sync for SimpleProtocolUpgrade<TInfo>where
TInfo: Sync,
impl<TInfo> Unpin for SimpleProtocolUpgrade<TInfo>where
TInfo: Unpin,
impl<TInfo> UnwindSafe for SimpleProtocolUpgrade<TInfo>where
TInfo: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U, T> InboundConnectionUpgrade<T> for Uwhere
U: InboundUpgrade<T>,
impl<U, T> InboundConnectionUpgrade<T> for Uwhere
U: InboundUpgrade<T>,
Source§type Output = <U as InboundUpgrade<T>>::Output
type Output = <U as InboundUpgrade<T>>::Output
Output after the upgrade has been successfully negotiated and the handshake performed.
Source§type Error = <U as InboundUpgrade<T>>::Error
type Error = <U as InboundUpgrade<T>>::Error
Possible error during the handshake.
Source§type Future = <U as InboundUpgrade<T>>::Future
type Future = <U as InboundUpgrade<T>>::Future
Future that performs the handshake with the remote.
Source§fn upgrade_inbound(
self,
socket: T,
info: <U as UpgradeInfo>::Info,
) -> <U as InboundConnectionUpgrade<T>>::Future
fn upgrade_inbound( self, socket: T, info: <U as UpgradeInfo>::Info, ) -> <U as InboundConnectionUpgrade<T>>::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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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<U, T> OutboundConnectionUpgrade<T> for Uwhere
U: OutboundUpgrade<T>,
impl<U, T> OutboundConnectionUpgrade<T> for Uwhere
U: OutboundUpgrade<T>,
Source§type Output = <U as OutboundUpgrade<T>>::Output
type Output = <U as OutboundUpgrade<T>>::Output
Output after the upgrade has been successfully negotiated and the handshake performed.
Source§type Error = <U as OutboundUpgrade<T>>::Error
type Error = <U as OutboundUpgrade<T>>::Error
Possible error during the handshake.
Source§type Future = <U as OutboundUpgrade<T>>::Future
type Future = <U as OutboundUpgrade<T>>::Future
Future that performs the handshake with the remote.
Source§fn upgrade_outbound(
self,
socket: T,
info: <U as UpgradeInfo>::Info,
) -> <U as OutboundConnectionUpgrade<T>>::Future
fn upgrade_outbound( self, socket: T, info: <U as UpgradeInfo>::Info, ) -> <U as OutboundConnectionUpgrade<T>>::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