pub struct Peer { /* private fields */ }Expand description
A type holding information related to a peer.
Implementations§
Source§impl Peer
impl Peer
Sourcepub fn relation(&self) -> PeerRelation
pub fn relation(&self) -> PeerRelation
Returns the relationship kind of the Peer.
Sourcepub fn set_connected(&self, connected: bool)
pub fn set_connected(&self, connected: bool)
Returns whether the Peer is connected or not.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Sets whether the Peer is connected or not.
Sourcepub fn metrics(&self) -> &PeerMetrics
pub fn metrics(&self) -> &PeerMetrics
Returns the metrics of the Peer.
Sourcepub fn set_solid_milestone_index(&self, index: MilestoneIndex)
pub fn set_solid_milestone_index(&self, index: MilestoneIndex)
Sets the solid milestone index of the Peer.
Sourcepub fn solid_milestone_index(&self) -> MilestoneIndex
pub fn solid_milestone_index(&self) -> MilestoneIndex
Returns the solid milestone index of the Peer.
Sourcepub fn set_pruned_index(&self, index: MilestoneIndex)
pub fn set_pruned_index(&self, index: MilestoneIndex)
Sets the pruned index of the Peer.
Sourcepub fn pruned_index(&self) -> MilestoneIndex
pub fn pruned_index(&self) -> MilestoneIndex
Returns the pruned index of the Peer.
Sourcepub fn set_latest_milestone_index(&self, index: MilestoneIndex)
pub fn set_latest_milestone_index(&self, index: MilestoneIndex)
Sets the latest milestone index of the Peer.
Sourcepub fn latest_milestone_index(&self) -> MilestoneIndex
pub fn latest_milestone_index(&self) -> MilestoneIndex
Returns the latest milestone index of the Peer.
Sourcepub fn set_connected_peers(&self, connected_peers: u8)
pub fn set_connected_peers(&self, connected_peers: u8)
Sets the number of connected peers of the Peer.
Sourcepub fn connected_peers(&self) -> u8
pub fn connected_peers(&self) -> u8
Returns the number of connected peers of the Peer.
Sourcepub fn set_synced_peers(&self, synced_peers: u8)
pub fn set_synced_peers(&self, synced_peers: u8)
Sets the number of synced peers of the Peer.
Sourcepub fn synced_peers(&self) -> u8
pub fn synced_peers(&self) -> u8
Returns the number of synced peers of the Peer.
Sourcepub fn set_heartbeat_sent_timestamp(&self)
pub fn set_heartbeat_sent_timestamp(&self)
Sets the timestamp of the last heartbeat sent by the Peer.
Sourcepub fn heartbeat_sent_timestamp(&self) -> u64
pub fn heartbeat_sent_timestamp(&self) -> u64
Returns the timestamp of the last heartbeat sent by the Peer.
Sourcepub fn set_heartbeat_received_timestamp(&self)
pub fn set_heartbeat_received_timestamp(&self)
Sets the timestamp of the last heartbeat received by the Peer.
Sourcepub fn heartbeat_received_timestamp(&self) -> u64
pub fn heartbeat_received_timestamp(&self) -> u64
Returns the timestamp of the last heartbeat received by the Peer.
Sourcepub fn is_synced_threshold(&self, threshold: u32) -> bool
pub fn is_synced_threshold(&self, threshold: u32) -> bool
Returns whether the Peer is synced with a threshold or not.
Sourcepub fn has_data(&self, index: MilestoneIndex) -> bool
pub fn has_data(&self, index: MilestoneIndex) -> bool
Returns whether the Peer has the data referenced by a given milestone index.
Sourcepub fn maybe_has_data(&self, index: MilestoneIndex) -> bool
pub fn maybe_has_data(&self, index: MilestoneIndex) -> bool
Returns whether the Peer may have the data referenced by a given milestone index.