Struct jormungandr::topology::P2pTopology
source · pub struct P2pTopology {
topology: Topology,
quarantine: ReportRecords,
key: SecretKey,
stats_counter: Metrics,
}
Expand description
object holding the P2pTopology of the Node
Fields§
§topology: Topology
§quarantine: ReportRecords
§key: SecretKey
§stats_counter: Metrics
Implementations§
source§impl P2pTopology
impl P2pTopology
pub fn new(config: &Configuration, stats_counter: Metrics) -> Self
sourcepub fn view(&mut self, selection: Selection) -> View
pub fn view(&mut self, selection: Selection) -> View
Returns a list of neighbors selected in this turn to contact for event dissemination.
pub fn initiate_gossips(&mut self, recipient: &NodeId) -> Gossips
pub fn accept_gossips(&mut self, gossips: Gossips)
pub fn list_quarantined(&self) -> Vec<PeerInfo>
sourcepub fn list_available(&self) -> impl Iterator<Item = Peer> + '_
pub fn list_available(&self) -> impl Iterator<Item = Peer> + '_
This returns the peers known to the node which are not quarantined. Please note some of these may not be present in the topology view.
pub fn list_non_public(&self) -> impl Iterator<Item = Peer> + '_
sourcepub fn promote_node(&mut self, node: &NodeId)
pub fn promote_node(&mut self, node: &NodeId)
register that we were able to establish an handshake with given peer
sourcepub fn report_node(&mut self, node_id: &NodeId)
pub fn report_node(&mut self, node_id: &NodeId)
register a strike against the given peer
sourcepub fn update_gossip(&mut self)
pub fn update_gossip(&mut self)
update our gossip so that other nodes can see that we are updating it and are alive
pub fn lift_reports(&mut self) -> Vec<Peer>
fn peer_available_cnt(&self) -> usize
Auto Trait Implementations§
impl !RefUnwindSafe for P2pTopology
impl Send for P2pTopology
impl !Sync for P2pTopology
impl Unpin for P2pTopology
impl !UnwindSafe for P2pTopology
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request