Enum tetsy_multistream_select::Version[][src]

pub enum Version {

Supported tetsy-multistream-select versions.



Version 1 of the tetsy-multistream-select protocol. See 1 and 2.


A “lazy” variant of version 1 that is identical on the wire but whereby the dialer delays flushing protocol negotiation data in order to combine it with initial application data, thus performing 0-RTT negotiation.

This strategy is only applicable for the node with the role of “dialer” in the negotiation and only if the dialer supports just a single application protocol. In that case the dialer immedidately “settles” on that protocol, buffering the negotiation messages to be sent with the first round of application protocol data (or an attempt is made to read from the Negotiated I/O stream).

A listener will behave identically to V1. This ensures interoperability with V1. Notably, it will immediately send the multistream header as well as the protocol confirmation, resulting in multiple frames being sent on the underlying transport. Nevertheless, if the listener supports the protocol that the dialer optimistically settled on, it can be a 0-RTT negotiation.

Note: V1Lazy is specific to rust-libp2p. The wire protocol is identical to V1 and generally interoperable with peers only supporting V1. Nevertheless, there is a pitfall that is rarely encountered: When nesting multiple protocol negotiations, the listener should either be known to support all of the dialer’s optimistically chosen protocols or there is must be no intermediate protocol without a payload and none of the protocol payloads must have the potential for being mistaken for a tetsy-multistream-select protocol message. This avoids rare edge-cases whereby the listener may not recognize upgrade boundaries and erroneously process a request despite not supporting one of the intermediate protocols that the dialer committed to. See 1 and 2.

Trait Implementations

impl Clone for Version[src]

impl Copy for Version[src]

impl Debug for Version[src]

impl Default for Version[src]

impl Eq for Version[src]

impl PartialEq<Version> for Version[src]

impl StructuralEq for Version[src]

impl StructuralPartialEq for Version[src]

Auto Trait Implementations

impl RefUnwindSafe for Version

impl Send for Version

impl Sync for Version

impl Unpin for Version

impl UnwindSafe for Version

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.