Enum libp2p_core::transport::upgrade::Version [−][src]
Supported multistream-select versions.
Variants
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 torust-libp2p
. The wire protocol is identical toV1
and generally interoperable with peers only supportingV1
. 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 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]
pub fn eq(&self, other: &Version) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Version
[src]
impl StructuralPartialEq for Version
[src]
Auto Trait Implementations
impl RefUnwindSafe for Version
[src]
impl Send for Version
[src]
impl Sync for Version
[src]
impl Unpin for Version
[src]
impl UnwindSafe for Version
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,