pub(crate) struct ProtocolsInner {
pub(crate) recognized: [u64; 13],
pub(crate) unrecognized: Vec<SubprotocolEntry>,
}Expand description
Inner representation of Protocols.
We make this a separate type so that we can intern it inside an Arc.
Fields§
§recognized: [u64; 13]A mapping from protocols’ integer encodings to bit-vectors.
unrecognized: Vec<SubprotocolEntry>A vector of unrecognized protocol versions, in sorted order.
Every entry in this list has supported != 0.
Implementations§
Source§impl ProtocolsInner
impl ProtocolsInner
Sourcepub(crate) fn add(
&mut self,
foundmask: &mut u64,
ent: SubprotocolEntry,
) -> Result<(), ParseError>
pub(crate) fn add( &mut self, foundmask: &mut u64, ent: SubprotocolEntry, ) -> Result<(), ParseError>
Parsing helper: Try to add a new entry ent to this set of protocols.
Uses foundmask, a bit mask saying which recognized protocols
we’ve already found entries for. Returns an error if ent is
for a protocol we’ve already added.
Does not preserve sorting order; the caller must call self.unrecognized.sort() before returning.
Trait Implementations§
Source§impl Clone for ProtocolsInner
impl Clone for ProtocolsInner
Source§fn clone(&self) -> ProtocolsInner
fn clone(&self) -> ProtocolsInner
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 moreSource§impl Debug for ProtocolsInner
impl Debug for ProtocolsInner
Source§impl Default for ProtocolsInner
impl Default for ProtocolsInner
Source§fn default() -> ProtocolsInner
fn default() -> ProtocolsInner
Returns the “default value” for a type. Read more
Source§impl From<ProtocolsInner> for Protocols
impl From<ProtocolsInner> for Protocols
Source§fn from(value: ProtocolsInner) -> Self
fn from(value: ProtocolsInner) -> Self
Converts to this type from the input type.
Source§impl Hash for ProtocolsInner
impl Hash for ProtocolsInner
Source§impl PartialEq for ProtocolsInner
impl PartialEq for ProtocolsInner
Source§fn eq(&self, other: &ProtocolsInner) -> bool
fn eq(&self, other: &ProtocolsInner) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ProtocolsInner
impl StructuralPartialEq for ProtocolsInner
Auto Trait Implementations§
impl Freeze for ProtocolsInner
impl RefUnwindSafe for ProtocolsInner
impl Send for ProtocolsInner
impl Sync for ProtocolsInner
impl Unpin for ProtocolsInner
impl UnsafeUnpin for ProtocolsInner
impl UnwindSafe for ProtocolsInner
Blanket Implementations§
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
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