pub struct NonDefaultSetConfig { /* private fields */ }
Expand description
Extension to SetConfig
for sets that aren’t the default set.
Note: As new fields might be added in the future, please consider using the
new
method and modifiers instead of creating this struct manually.
Implementations§
Source§impl NonDefaultSetConfig
impl NonDefaultSetConfig
Sourcepub fn new(
protocol_name: ProtocolName,
fallback_names: Vec<ProtocolName>,
max_notification_size: u64,
handshake: Option<NotificationHandshake>,
set_config: SetConfig,
) -> (Self, Box<dyn NotificationService>)
pub fn new( protocol_name: ProtocolName, fallback_names: Vec<ProtocolName>, max_notification_size: u64, handshake: Option<NotificationHandshake>, set_config: SetConfig, ) -> (Self, Box<dyn NotificationService>)
Creates a new NonDefaultSetConfig
. Zero slots and accepts only reserved nodes.
Also returns an object which allows the protocol to communicate with Notifications
.
Sourcepub fn protocol_name(&self) -> &ProtocolName
pub fn protocol_name(&self) -> &ProtocolName
Get reference to protocol name.
Sourcepub fn fallback_names(&self) -> impl Iterator<Item = &ProtocolName>
pub fn fallback_names(&self) -> impl Iterator<Item = &ProtocolName>
Get reference to fallback protocol names.
Sourcepub fn handshake(&self) -> &Option<NotificationHandshake>
pub fn handshake(&self) -> &Option<NotificationHandshake>
Get reference to handshake.
Sourcepub fn max_notification_size(&self) -> u64
pub fn max_notification_size(&self) -> u64
Get maximum notification size.
Sourcepub fn set_config(&self) -> &SetConfig
pub fn set_config(&self) -> &SetConfig
Get reference to SetConfig
.
Sourcepub fn take_protocol_handle(self) -> ProtocolHandlePair
pub fn take_protocol_handle(self) -> ProtocolHandlePair
Take ProtocolHandlePair
from NonDefaultSetConfig
Sourcepub fn allow_non_reserved(&mut self, in_peers: u32, out_peers: u32)
pub fn allow_non_reserved(&mut self, in_peers: u32, out_peers: u32)
Modifies the configuration to allow non-reserved nodes.
Sourcepub fn add_reserved(&mut self, peer: MultiaddrWithPeerId)
pub fn add_reserved(&mut self, peer: MultiaddrWithPeerId)
Add a node to the list of reserved nodes.
Sourcepub fn add_fallback_names(&mut self, fallback_names: Vec<ProtocolName>)
pub fn add_fallback_names(&mut self, fallback_names: Vec<ProtocolName>)
Add a list of protocol names used for backward compatibility.
See the explanations in NonDefaultSetConfig::fallback_names
.
Trait Implementations§
Source§impl Debug for NonDefaultSetConfig
impl Debug for NonDefaultSetConfig
Source§impl NotificationConfig for NonDefaultSetConfig
impl NotificationConfig for NonDefaultSetConfig
Source§fn protocol_name(&self) -> &ProtocolName
fn protocol_name(&self) -> &ProtocolName
Get reference to protocol name.
Source§fn set_config(&self) -> &SetConfig
fn set_config(&self) -> &SetConfig
SetConfig
of the notification protocol.Auto Trait Implementations§
impl Freeze for NonDefaultSetConfig
impl !RefUnwindSafe for NonDefaultSetConfig
impl Send for NonDefaultSetConfig
impl Sync for NonDefaultSetConfig
impl Unpin for NonDefaultSetConfig
impl !UnwindSafe for NonDefaultSetConfig
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
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
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 moreSource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read moreSource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.