Struct ckb_network::network::NetworkController [−][src]
pub struct NetworkController { /* fields omitted */ }
Expand description
Network controller
Implementations
impl NetworkController
[src]
impl NetworkController
[src]pub fn remove_node(&self, peer_id: &PeerId)
[src]
pub fn remove_node(&self, peer_id: &PeerId)
[src]Disconnect session with peer id
pub fn get_banned_addrs(&self) -> Vec<BannedAddr>
[src]
pub fn get_banned_addrs(&self) -> Vec<BannedAddr>
[src]Get banned peer list
pub fn clear_banned_addrs(&self)
[src]
pub fn clear_banned_addrs(&self)
[src]Clear banned list
pub fn ban(
&self,
address: IpNetwork,
ban_until: u64,
ban_reason: String
) -> Result<(), Error>
[src]
pub fn ban(
&self,
address: IpNetwork,
ban_until: u64,
ban_reason: String
) -> Result<(), Error>
[src]Ban an ip
pub fn ban_peer(
&self,
peer_index: PeerIndex,
duration: Duration,
reason: String
)
[src]
pub fn ban_peer(
&self,
peer_index: PeerIndex,
duration: Duration,
reason: String
)
[src]Ban an peer through peer index
pub fn broadcast(
&self,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]
pub fn broadcast(
&self,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]Broadcast a message to all connected peers
pub fn quick_broadcast(
&self,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]
pub fn quick_broadcast(
&self,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]Broadcast a message to all connected peers through quick queue
pub fn send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]
pub fn send_message_to(
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]Send message to one connected peer
pub fn is_active(&self) -> bool
[src]
pub fn is_active(&self) -> bool
[src]network message processing controller, always true, if false, discard any received messages
pub fn set_active(&self, active: bool)
[src]
pub fn set_active(&self, active: bool)
[src]Change active status, if set false discard any received messages
pub fn protocols(&self) -> Vec<(ProtocolId, String, Vec<String>)>
[src]
pub fn protocols(&self) -> Vec<(ProtocolId, String, Vec<String>)>
[src]Return all connected peers’ protocols info
pub fn ping_peers(&self)
[src]
pub fn ping_peers(&self)
[src]Try ping all connected peers
Trait Implementations
impl Clone for NetworkController
[src]
impl Clone for NetworkController
[src]fn clone(&self) -> NetworkController
[src]
fn clone(&self) -> NetworkController
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for NetworkController
impl Send for NetworkController
impl Sync for NetworkController
impl Unpin for NetworkController
impl !UnwindSafe for NetworkController
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,