pub struct ProtocolCompatibility {
pub protocol_version: u32,
pub mandatory_features: Vec<i32>,
}Fields§
§protocol_version: u32HYBRID peers require exactly 2.
mandatory_features: Vec<i32>Sorted unique.
Implementations§
Source§impl ProtocolCompatibility
impl ProtocolCompatibility
Sourcepub fn mandatory_features(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<MandatoryProtocolFeature>> ⓘ
pub fn mandatory_features( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(i32) -> Option<MandatoryProtocolFeature>> ⓘ
Returns an iterator which yields the valid enum values contained in mandatory_features.
Sourcepub fn push_mandatory_features(&mut self, value: MandatoryProtocolFeature)
pub fn push_mandatory_features(&mut self, value: MandatoryProtocolFeature)
Appends the provided enum value to mandatory_features.
Trait Implementations§
Source§impl Clone for ProtocolCompatibility
impl Clone for ProtocolCompatibility
Source§impl Debug for ProtocolCompatibility
impl Debug for ProtocolCompatibility
Source§impl Default for ProtocolCompatibility
impl Default for ProtocolCompatibility
impl Eq for ProtocolCompatibility
Source§impl Hash for ProtocolCompatibility
impl Hash for ProtocolCompatibility
Source§impl Message for ProtocolCompatibility
impl Message for ProtocolCompatibility
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for ProtocolCompatibility
impl PartialEq for ProtocolCompatibility
impl StructuralPartialEq for ProtocolCompatibility
Auto Trait Implementations§
impl Freeze for ProtocolCompatibility
impl RefUnwindSafe for ProtocolCompatibility
impl Send for ProtocolCompatibility
impl Sync for ProtocolCompatibility
impl Unpin for ProtocolCompatibility
impl UnsafeUnpin for ProtocolCompatibility
impl UnwindSafe for ProtocolCompatibility
Blanket Implementations§
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