pub struct NegotiatedSet {
pub compatible: HashSet<u16>,
pub incompatible: Vec<(u16, SubprotocolVersion, SubprotocolVersion)>,
}Expand description
Result of negotiation between two peers.
Fields§
§compatible: HashSet<u16>Subprotocol IDs that both peers support at compatible versions.
incompatible: Vec<(u16, SubprotocolVersion, SubprotocolVersion)>Subprotocol IDs where version mismatch was detected. Tuple: (id, local_version, remote_version).
Implementations§
Source§impl NegotiatedSet
impl NegotiatedSet
Sourcepub fn is_compatible(&self, id: u16) -> bool
pub fn is_compatible(&self, id: u16) -> bool
Check if a subprotocol is negotiated (compatible on both sides).
Sourcepub fn compatible_count(&self) -> usize
pub fn compatible_count(&self) -> usize
Number of compatible subprotocols.
Trait Implementations§
Source§impl Clone for NegotiatedSet
impl Clone for NegotiatedSet
Source§fn clone(&self) -> NegotiatedSet
fn clone(&self) -> NegotiatedSet
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 NegotiatedSet
impl RefUnwindSafe for NegotiatedSet
impl Send for NegotiatedSet
impl Sync for NegotiatedSet
impl Unpin for NegotiatedSet
impl UnsafeUnpin for NegotiatedSet
impl UnwindSafe for NegotiatedSet
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