Struct bee_protocol_types::peer::Peer
source · [−]pub struct Peer { /* private fields */ }Expand description
A type holding information related to a peer.
Implementations
sourceimpl 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.