Struct sc_network::config::NonDefaultSetConfig
source · 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
newmethod 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§
Auto Trait Implementations§
impl !RefUnwindSafe for NonDefaultSetConfig
impl Send for NonDefaultSetConfig
impl Sync for NonDefaultSetConfig
impl Unpin for NonDefaultSetConfig
impl !UnwindSafe for NonDefaultSetConfig
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
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§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.