Struct exonum::blockchain::SharedNodeState
[−]
[src]
pub struct SharedNodeState { pub state_update_timeout: Milliseconds, // some fields omitted }
Shared part of the context, used to take some values from the Node
s State
should be used to take some metrics.
Fields
state_update_timeout: Milliseconds
Timeout to update api state.
Methods
impl SharedNodeState
[src]
fn new(state_update_timeout: Milliseconds) -> SharedNodeState
[src]
Creates new SharedNodeState
fn incoming_connections(&self) -> Vec<SocketAddr>
[src]
Return list of connected sockets
fn outgoing_connections(&self) -> Vec<SocketAddr>
[src]
Return list of our connection sockets
fn reconnects_timeout(&self) -> Vec<(SocketAddr, Milliseconds)>
[src]
Return reconnects list
fn peers_info(&self) -> Vec<(SocketAddr, PublicKey)>
[src]
Return peers info list
fn update_node_state(&self, state: &State)
[src]
Update internal state, from Node
State`
fn state_update_timeout(&self) -> Milliseconds
[src]
Returns value of the state_update_timeout
.
fn add_incoming_connection(&self, addr: SocketAddr)
[src]
add incomming connection into state
fn add_outgoing_connection(&self, addr: SocketAddr)
[src]
add outgoing connection into state
fn remove_incoming_connection(&self, addr: &SocketAddr) -> bool
[src]
remove incomming connection from state
fn remove_outgoing_connection(&self, addr: &SocketAddr) -> bool
[src]
remove outgoing connection from state
fn add_reconnect_timeout(
&self,
addr: SocketAddr,
timeout: Milliseconds
) -> Option<Milliseconds>
[src]
&self,
addr: SocketAddr,
timeout: Milliseconds
) -> Option<Milliseconds>
Add reconect timeout
fn remove_reconnect_timeout(&self, addr: &SocketAddr) -> Option<Milliseconds>
[src]
Removes reconect timeout and returns the previous value.
Trait Implementations
impl Clone for SharedNodeState
[src]
fn clone(&self) -> SharedNodeState
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more