[−][src]Struct ckb_network::network::NetworkController
Network controller
Implementations
impl NetworkController
[src]
pub fn public_urls(&self, max_urls: usize) -> Vec<(String, u8)>
[src]
Node listen address list
pub fn version(&self) -> &String
[src]
ckb version
pub fn node_id(&self) -> String
[src]
Node peer id's base58 format string
pub fn add_node(&self, peer_id: &PeerId, address: Multiaddr)
[src]
Dial remote node
pub fn remove_node(&self, peer_id: &PeerId)
[src]
Disconnect session with peer id
pub fn get_banned_addrs(&self) -> Vec<BannedAddr>
[src]
Get banned peer list
pub fn clear_banned_addrs(&self)
[src]
Clear banned list
pub fn addr_info(&self, ip_port: &IpPort) -> Option<AddrInfo>
[src]
Get address info from peer store
pub fn ban(
&self,
address: IpNetwork,
ban_until: u64,
ban_reason: String
) -> Result<(), Error>
[src]
&self,
address: IpNetwork,
ban_until: u64,
ban_reason: String
) -> Result<(), Error>
Ban an ip
pub fn unban(&self, address: &IpNetwork)
[src]
Unban an ip
pub fn connected_peers(&self) -> Vec<(PeerIndex, Peer)>
[src]
Return all connected peers' information
pub fn broadcast(
&self,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]
&self,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Broadcast a message to all connected peers
pub fn quick_broadcast(
&self,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
[src]
&self,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
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]
&self,
session_id: SessionId,
proto_id: ProtocolId,
data: Bytes
) -> Result<(), SendErrorKind>
Send message to one connected peer
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]
Change active status, if set false discard any received messages
pub fn protocols(&self) -> Vec<(ProtocolId, String, Vec<String>)>
[src]
Return all connected peers' protocols info
pub fn ping_peers(&self)
[src]
Try ping all connected peers
Trait Implementations
impl Clone for NetworkController
[src]
pub fn clone(&self) -> NetworkController
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Drop for NetworkController
[src]
Auto Trait Implementations
impl !RefUnwindSafe for NetworkController
[src]
impl Send for NetworkController
[src]
impl Sync for NetworkController
[src]
impl Unpin for NetworkController
[src]
impl !UnwindSafe for NetworkController
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,