Struct network::peer_manager::builder::PeerManagerBuilder
source · [−]pub struct PeerManagerBuilder { /* private fields */ }Implementations
sourceimpl PeerManagerBuilder
impl PeerManagerBuilder
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
pub fn listen_address(&self) -> NetworkAddress
pub fn connection_reqs_tx(&self) -> Sender<PeerId, ConnectionRequest>
sourcepub fn build(&mut self, executor: &Handle) -> &mut Self
pub fn build(&mut self, executor: &Handle) -> &mut Self
Create the configured transport and start PeerManager. Return the actual NetworkAddress over which this peer is listening.
pub fn start(&mut self, executor: &Handle)
pub fn add_connection_event_listener(&mut self) -> Receiver
sourcepub 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.
sourcepub 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.
sourcepub 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more