pub fn dialer_select_proto<R, I>(
) -> DialerSelectFuture<R, I::IntoIter> where
R: AsyncRead + AsyncWrite,
Future that negotiates a protocol on the given I/O stream
for a peer acting as the dialer (or initiator).
This function is given an I/O stream and a list of protocols and returns a
computation that performs the protocol negotiation with the remote. The
Future resolves with the name of the negotiated protocol and
Negotiated I/O stream.
The chosen message flow for protocol negotiation depends on the numbers of
supported protocols given. That is, this function delegates to serial or
parallel variant based on the number of protocols given. The number of
protocols is determined through the
size_hint of the given iterator and
thus an inaccurate size estimate may result in a suboptimal choice.
Within the scope of this library, a dialer always commits to a specific
Version, whereas a listener always supports
all versions supported by this library. Frictionless tetsy-multistream-select
protocol upgrades may thus proceed by deployments with updated listeners,
eventually followed by deployments of dialers choosing the newer protocol.