pub struct CapabilityConfig {
pub local_capabilities: Vec<PeerCapability>,
pub require_all: Vec<PeerCapability>,
pub require_any: Vec<PeerCapability>,
pub max_peers: usize,
pub ttl_ms: u64,
}Expand description
Configuration for the local node’s capability advertisement and peer filtering policy.
Fields§
§local_capabilities: Vec<PeerCapability>Capabilities that this local node advertises to remote peers.
require_all: Vec<PeerCapability>Peers that do not have all of these capabilities are rejected during
CapabilityRegistry::register.
require_any: Vec<PeerCapability>Peers that have none of these capabilities are rejected during
CapabilityRegistry::register. An empty list means no
require_any constraint.
max_peers: usizeMaximum number of peers the registry will hold simultaneously.
Attempts to register beyond this limit return false.
ttl_ms: u64Time-to-live in milliseconds after which a PeerCapabilitySet is
considered stale and eligible for purging.
Trait Implementations§
Source§impl Clone for CapabilityConfig
impl Clone for CapabilityConfig
Source§fn clone(&self) -> CapabilityConfig
fn clone(&self) -> CapabilityConfig
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 CapabilityConfig
impl Debug for CapabilityConfig
Auto Trait Implementations§
impl Freeze for CapabilityConfig
impl RefUnwindSafe for CapabilityConfig
impl Send for CapabilityConfig
impl Sync for CapabilityConfig
impl Unpin for CapabilityConfig
impl UnsafeUnpin for CapabilityConfig
impl UnwindSafe for CapabilityConfig
Blanket Implementations§
impl<T> Allocation for T
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
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<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