Struct Capability
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§
§impl Capability
impl Capability
pub const fn new(name: String, version: usize) -> Capability
pub const fn new(name: String, version: usize) -> Capability
Create a new Capability with the given name and version.
pub const fn new_static(name: &'static str, version: usize) -> Capability
pub const fn new_static(name: &'static str, version: usize) -> Capability
Create a new Capability with the given static name and version.
pub const fn eth(version: EthVersion) -> Capability
pub const fn eth(version: EthVersion) -> Capability
Returns the corresponding eth capability for the given version.
pub const fn snap(version: SnapVersion) -> Capability
pub const fn snap(version: SnapVersion) -> Capability
Returns the corresponding snap capability for the given version.
pub const fn eth_66() -> Capability
pub const fn eth_66() -> Capability
Returns the EthVersion::Eth66 capability.
pub const fn eth_67() -> Capability
pub const fn eth_67() -> Capability
Returns the EthVersion::Eth67 capability.
pub const fn eth_68() -> Capability
pub const fn eth_68() -> Capability
Returns the EthVersion::Eth68 capability.
pub const fn eth_69() -> Capability
pub const fn eth_69() -> Capability
Returns the EthVersion::Eth69 capability.
pub const fn eth_70() -> Capability
pub const fn eth_70() -> Capability
Returns the EthVersion::Eth70 capability.
pub const fn eth_71() -> Capability
pub const fn eth_71() -> Capability
Returns the EthVersion::Eth71 capability.
pub const fn eth_72() -> Capability
pub const fn eth_72() -> Capability
Returns the EthVersion::Eth72 capability.
pub const fn snap_2() -> Capability
pub const fn snap_2() -> Capability
Returns the snap/2 capability.
pub fn is_eth_v66(&self) -> bool
pub fn is_eth_v66(&self) -> bool
Whether this is eth v66 protocol.
pub fn is_eth_v67(&self) -> bool
pub fn is_eth_v67(&self) -> bool
Whether this is eth v67.
pub fn is_eth_v68(&self) -> bool
pub fn is_eth_v68(&self) -> bool
Whether this is eth v68.
pub fn is_eth_v69(&self) -> bool
pub fn is_eth_v69(&self) -> bool
Whether this is eth v69.
pub fn is_eth_v70(&self) -> bool
pub fn is_eth_v70(&self) -> bool
Whether this is eth v70.
pub fn is_eth_v71(&self) -> bool
pub fn is_eth_v71(&self) -> bool
Whether this is eth v71.
pub fn is_eth_v72(&self) -> bool
pub fn is_eth_v72(&self) -> bool
Whether this is eth v72.
Trait Implementations§
§impl<'a> Arbitrary<'a> for Capability
Available on crate features arbitrary only.
impl<'a> Arbitrary<'a> for Capability
arbitrary only.§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Capability, Error>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Capability, Error>
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 more§impl Clone for Capability
impl Clone for Capability
§fn clone(&self) -> Capability
fn clone(&self) -> Capability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for Capability
impl Debug for Capability
§impl Decodable for Capability
impl Decodable for Capability
§fn decode(b: &mut &[u8]) -> Result<Capability, Error>
fn decode(b: &mut &[u8]) -> Result<Capability, Error>
buf must be advanced past
the decoded object.§impl Default for Capability
impl Default for Capability
§fn default() -> Capability
fn default() -> Capability
§impl<'de> Deserialize<'de> for Capability
impl<'de> Deserialize<'de> for Capability
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Capability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Capability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Display for Capability
impl Display for Capability
§impl Encodable for Capability
impl Encodable for Capability
impl Eq for Capability
§impl From<EthVersion> for Capability
impl From<EthVersion> for Capability
§fn from(value: EthVersion) -> Capability
fn from(value: EthVersion) -> Capability
§impl Hash for Capability
impl Hash for Capability
§impl PartialEq for Capability
impl PartialEq for Capability
§impl Serialize for Capability
impl Serialize for Capability
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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