pub struct Capability {
pub name: Cow<'static, str>,
pub version: usize,
}Expand description
A message indicating a supported capability and capability version.
Fields§
§name: Cow<'static, str>The name of the subprotocol
version: usizeThe version of the subprotocol
Implementations§
Source§impl Capability
impl Capability
Sourcepub const fn new(name: String, version: usize) -> Self
pub const fn new(name: String, version: usize) -> Self
Create a new Capability with the given name and version.
Sourcepub const fn new_static(name: &'static str, version: usize) -> Self
pub const fn new_static(name: &'static str, version: usize) -> Self
Create a new Capability with the given static name and version.
Sourcepub const fn eth(version: EthVersion) -> Self
pub const fn eth(version: EthVersion) -> Self
Returns the corresponding eth capability for the given version.
Sourcepub const fn snap(version: SnapVersion) -> Self
pub const fn snap(version: SnapVersion) -> Self
Returns the corresponding snap capability for the given version.
Sourcepub const fn eth_66() -> Self
pub const fn eth_66() -> Self
Returns the EthVersion::Eth66 capability.
Sourcepub const fn eth_67() -> Self
pub const fn eth_67() -> Self
Returns the EthVersion::Eth67 capability.
Sourcepub const fn eth_68() -> Self
pub const fn eth_68() -> Self
Returns the EthVersion::Eth68 capability.
Sourcepub const fn eth_69() -> Self
pub const fn eth_69() -> Self
Returns the EthVersion::Eth69 capability.
Sourcepub const fn eth_70() -> Self
pub const fn eth_70() -> Self
Returns the EthVersion::Eth70 capability.
Sourcepub const fn eth_71() -> Self
pub const fn eth_71() -> Self
Returns the EthVersion::Eth71 capability.
Sourcepub const fn eth_72() -> Self
pub const fn eth_72() -> Self
Returns the EthVersion::Eth72 capability.
Sourcepub fn is_eth_v66(&self) -> bool
pub fn is_eth_v66(&self) -> bool
Whether this is eth v66 protocol.
Sourcepub fn is_eth_v67(&self) -> bool
pub fn is_eth_v67(&self) -> bool
Whether this is eth v67.
Sourcepub fn is_eth_v68(&self) -> bool
pub fn is_eth_v68(&self) -> bool
Whether this is eth v68.
Sourcepub fn is_eth_v69(&self) -> bool
pub fn is_eth_v69(&self) -> bool
Whether this is eth v69.
Sourcepub fn is_eth_v70(&self) -> bool
pub fn is_eth_v70(&self) -> bool
Whether this is eth v70.
Sourcepub fn is_eth_v71(&self) -> bool
pub fn is_eth_v71(&self) -> bool
Whether this is eth v71.
Sourcepub fn is_eth_v72(&self) -> bool
pub fn is_eth_v72(&self) -> bool
Whether this is eth v72.
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for Capability
Available on crate features arbitrary only.
impl<'a> Arbitrary<'a> for Capability
arbitrary only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self from the given unstructured data. Read more§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self from the entirety of the given
unstructured data. Read moreSource§impl Clone for Capability
impl Clone for Capability
Source§impl Debug for Capability
impl Debug for Capability
Source§impl Decodable for Capability
impl Decodable for Capability
Source§impl Default for Capability
impl Default for Capability
Source§impl<'de> Deserialize<'de> for Capability
impl<'de> Deserialize<'de> for Capability
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for Capability
impl Display for Capability
Source§impl Encodable for Capability
impl Encodable for Capability
impl Eq for Capability
Source§impl From<EthVersion> for Capability
impl From<EthVersion> for Capability
Source§fn from(value: EthVersion) -> Self
fn from(value: EthVersion) -> Self
Source§impl Hash for Capability
impl Hash for Capability
Source§impl PartialEq for Capability
impl PartialEq for Capability
Source§impl Serialize for Capability
impl Serialize for Capability
impl StructuralPartialEq for Capability
Auto Trait Implementations§
impl Freeze for Capability
impl RefUnwindSafe for Capability
impl Send for Capability
impl Sync for Capability
impl Unpin for Capability
impl UnsafeUnpin for Capability
impl UnwindSafe for Capability
Blanket Implementations§
impl<A> ArbInterop for 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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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 moreimpl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes