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 Intern
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,
strictness: ParseStrictness,
) -> Result<(), ParseError>
pub(crate) fn add( &mut self, foundmask: &mut u64, ent: SubprotocolEntry, strictness: ParseStrictness, ) -> 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 recognized protocol we’ve already added.
WARNING: This method DOES NOT enforce uniqueness for unrecognized protocols. The caller is responsible for doing that in a way appropriate for the provided strictness level.
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§impl Debug for ProtocolsInner
impl Debug for ProtocolsInner
Source§impl Default for ProtocolsInner
impl Default for ProtocolsInner
impl Eq for ProtocolsInner
Source§impl From<ProtocolsInner> for Protocols
impl From<ProtocolsInner> for Protocols
Source§fn from(value: ProtocolsInner) -> Self
fn from(value: ProtocolsInner) -> Self
Source§impl GloballyInternable for ProtocolsInner
impl GloballyInternable for ProtocolsInner
Source§fn intern_cache() -> &'static InternCache<Self>
fn intern_cache() -> &'static InternCache<Self>
Source§impl Hash for ProtocolsInner
impl Hash for ProtocolsInner
Source§impl PartialEq for ProtocolsInner
impl PartialEq 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
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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 more