Struct network::peer_manager::builder::PeerManagerBuilder [−][src]
pub struct PeerManagerBuilder { /* fields omitted */ }Implementations
pub fn create(
chain_id: ChainId,
network_context: NetworkContext,
time_service: TimeService,
listen_address: NetworkAddress,
peer_metadata_storage: Arc<PeerMetadataStorage>,
trusted_peers: Arc<RwLock<PeerSet>>,
authentication_mode: AuthenticationMode,
channel_size: usize,
max_concurrent_network_reqs: usize,
max_frame_size: usize,
enable_proxy_protocol: bool,
inbound_connection_limit: usize,
inbound_rate_limit_config: Option<RateLimitConfig>,
outbound_rate_limit_config: Option<RateLimitConfig>
) -> Self
Create the configured transport and start PeerManager. Return the actual NetworkAddress over which this peer is listening.
pub fn add_p2p_service(
&mut self,
config: &AppConfig
) -> ((PeerManagerRequestSender, ConnectionRequestSender), (Receiver<(PeerId, ProtocolId), PeerManagerNotification>, Receiver))
pub fn add_p2p_service(
&mut self,
config: &AppConfig
) -> ((PeerManagerRequestSender, ConnectionRequestSender), (Receiver<(PeerId, ProtocolId), PeerManagerNotification>, Receiver))
Register a peer-to-peer service (i.e., both client and service) for given protocols.
pub fn add_client(
&mut self,
config: &AppConfig
) -> (PeerManagerRequestSender, ConnectionRequestSender)
pub fn add_client(
&mut self,
config: &AppConfig
) -> (PeerManagerRequestSender, ConnectionRequestSender)
Register a client that’s interested in some set of protocols and return the outbound channels into network.
pub fn add_service(
&mut self,
config: &AppConfig
) -> (Receiver<(PeerId, ProtocolId), PeerManagerNotification>, Receiver)
pub fn add_service(
&mut self,
config: &AppConfig
) -> (Receiver<(PeerId, ProtocolId), PeerManagerNotification>, Receiver)
Register a service for handling some protocols.
Auto Trait Implementations
impl !RefUnwindSafe for PeerManagerBuilder
impl Send for PeerManagerBuilder
impl !Sync for PeerManagerBuilder
impl Unpin for PeerManagerBuilder
impl !UnwindSafe for PeerManagerBuilder
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self