pub struct ProtocolDescriptor {
pub name: String,
pub version: ProtocolVersion,
pub min_compatible: ProtocolVersion,
pub features: Vec<String>,
}Expand description
Full description of a protocol as advertised by one side of a connection.
A ProtocolDescriptor captures both the current version and the oldest
version that the advertising peer can still speak (min_compatible), plus
the list of optional features it supports.
Fields§
§name: StringHuman-readable protocol name, e.g. "ipfrs/bitswap".
version: ProtocolVersionThe version this peer is currently running.
min_compatible: ProtocolVersionThe oldest version this peer can still inter-operate with.
features: Vec<String>Optional feature strings this peer advertises.
Implementations§
Source§impl ProtocolDescriptor
impl ProtocolDescriptor
Sourcepub fn new(
name: impl Into<String>,
version: ProtocolVersion,
min_compatible: ProtocolVersion,
features: Vec<String>,
) -> Self
pub fn new( name: impl Into<String>, version: ProtocolVersion, min_compatible: ProtocolVersion, features: Vec<String>, ) -> Self
Convenience constructor.
Trait Implementations§
Source§impl Clone for ProtocolDescriptor
impl Clone for ProtocolDescriptor
Source§fn clone(&self) -> ProtocolDescriptor
fn clone(&self) -> ProtocolDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ProtocolDescriptor
impl RefUnwindSafe for ProtocolDescriptor
impl Send for ProtocolDescriptor
impl Sync for ProtocolDescriptor
impl Unpin for ProtocolDescriptor
impl UnsafeUnpin for ProtocolDescriptor
impl UnwindSafe for ProtocolDescriptor
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more