pub trait PeerTableServerProtocol: Send + Sync {
Show 45 methods
// Required methods
fn new_contacts(
&self,
nodes: Vec<Node>,
protocol: DiscoveryProtocol,
) -> Result<(), ActorError>;
fn new_contact_records(
&self,
node_records: Vec<NodeRecord>,
) -> Result<(), ActorError>;
fn new_connected_peer(
&self,
node: Node,
connection: PeerConnection,
capabilities: Vec<Capability>,
) -> Result<(), ActorError>;
fn set_session_info(
&self,
node_id: H256,
session: Session,
) -> Result<(), ActorError>;
fn remove_peer(&self, node_id: H256) -> Result<(), ActorError>;
fn dec_requests(&self, node_id: H256) -> Result<(), ActorError>;
fn set_unwanted(&self, node_id: H256) -> Result<(), ActorError>;
fn set_is_fork_id_valid(
&self,
node_id: H256,
valid: bool,
) -> Result<(), ActorError>;
fn record_success(&self, node_id: H256) -> Result<(), ActorError>;
fn record_failure(&self, node_id: H256) -> Result<(), ActorError>;
fn record_critical_failure(&self, node_id: H256) -> Result<(), ActorError>;
fn record_ping_sent(
&self,
node_id: H256,
ping_id: Bytes,
) -> Result<(), ActorError>;
fn record_pong_received(
&self,
node_id: H256,
ping_id: Bytes,
) -> Result<(), ActorError>;
fn record_enr_request_sent(
&self,
node_id: H256,
request_hash: H256,
) -> Result<(), ActorError>;
fn record_enr_response_received(
&self,
node_id: H256,
request_hash: H256,
record: NodeRecord,
) -> Result<(), ActorError>;
fn set_disposable(&self, node_id: H256) -> Result<(), ActorError>;
fn mark_knows_us(&self, node_id: H256) -> Result<(), ActorError>;
fn prune_table(&self) -> Result<(), ActorError>;
fn shutdown(&self) -> Result<(), ActorError>;
fn peer_count(&self) -> Response<usize>;
fn peer_count_by_capabilities(
&self,
capabilities: Vec<Capability>,
) -> Response<usize>;
fn target_reached(&self) -> Response<bool>;
fn target_peers_reached(&self) -> Response<bool>;
fn target_peers_completion(&self) -> Response<f64>;
fn get_contact_to_initiate(&self) -> Response<Option<Box<Contact>>>;
fn get_contact_for_enr_lookup(&self) -> Response<Option<Box<Contact>>>;
fn get_closest_from_pool(
&self,
target: H256,
count: usize,
) -> Response<Vec<(H256, Node)>>;
fn get_contact(&self, node_id: H256) -> Response<Option<Box<Contact>>>;
fn get_contact_to_revalidate(
&self,
revalidation_interval: Duration,
protocol: DiscoveryProtocol,
) -> Response<Option<Box<Contact>>>;
fn get_best_peer(
&self,
capabilities: Vec<Capability>,
) -> Response<Option<(H256, PeerConnection, RequestPermit)>>;
fn get_best_peer_excluding(
&self,
capabilities: Vec<Capability>,
excluded: Vec<H256>,
) -> Response<Option<(H256, PeerConnection, RequestPermit)>>;
fn get_best_n_peers(
&self,
capabilities: Vec<Capability>,
n: usize,
) -> Response<Vec<(H256, PeerConnection, RequestPermit)>>;
fn has_eligible_peer(&self, capabilities: Vec<Capability>) -> Response<bool>;
fn get_score(&self, node_id: H256) -> Response<i64>;
fn get_connected_nodes(&self) -> Response<Vec<Node>>;
fn get_peers_with_capabilities(
&self,
) -> Response<Vec<(H256, PeerConnection, Vec<Capability>)>>;
fn insert_if_new(
&self,
node: Node,
protocol: DiscoveryProtocol,
) -> Response<bool>;
fn validate_contact(
&self,
node_id: H256,
sender_ip: IpAddr,
) -> Response<ContactValidation>;
fn get_closest_nodes(&self, node_id: H256) -> Response<Vec<Node>>;
fn get_nodes_at_distances(
&self,
distances: Vec<u32>,
) -> Response<Vec<NodeRecord>>;
fn get_peers_data(&self) -> Response<Vec<PeerData>>;
fn get_random_peer(
&self,
capabilities: Vec<Capability>,
) -> Response<Option<(H256, PeerConnection, RequestPermit)>>;
fn get_session_info(&self, node_id: H256) -> Response<Option<Session>>;
fn get_peer_diagnostics(&self) -> Response<Vec<PeerDiagnostics>>;
fn get_peer_connection(
&self,
peer_id: H256,
) -> Response<Option<PeerConnection>>;
}Required Methods§
fn new_contacts( &self, nodes: Vec<Node>, protocol: DiscoveryProtocol, ) -> Result<(), ActorError>
fn new_contact_records( &self, node_records: Vec<NodeRecord>, ) -> Result<(), ActorError>
fn new_connected_peer( &self, node: Node, connection: PeerConnection, capabilities: Vec<Capability>, ) -> Result<(), ActorError>
fn set_session_info( &self, node_id: H256, session: Session, ) -> Result<(), ActorError>
fn remove_peer(&self, node_id: H256) -> Result<(), ActorError>
fn dec_requests(&self, node_id: H256) -> Result<(), ActorError>
fn set_unwanted(&self, node_id: H256) -> Result<(), ActorError>
fn set_is_fork_id_valid( &self, node_id: H256, valid: bool, ) -> Result<(), ActorError>
fn record_success(&self, node_id: H256) -> Result<(), ActorError>
fn record_failure(&self, node_id: H256) -> Result<(), ActorError>
fn record_critical_failure(&self, node_id: H256) -> Result<(), ActorError>
fn record_ping_sent( &self, node_id: H256, ping_id: Bytes, ) -> Result<(), ActorError>
fn record_pong_received( &self, node_id: H256, ping_id: Bytes, ) -> Result<(), ActorError>
fn record_enr_request_sent( &self, node_id: H256, request_hash: H256, ) -> Result<(), ActorError>
fn record_enr_response_received( &self, node_id: H256, request_hash: H256, record: NodeRecord, ) -> Result<(), ActorError>
fn set_disposable(&self, node_id: H256) -> Result<(), ActorError>
fn mark_knows_us(&self, node_id: H256) -> Result<(), ActorError>
fn prune_table(&self) -> Result<(), ActorError>
fn shutdown(&self) -> Result<(), ActorError>
fn peer_count(&self) -> Response<usize>
fn peer_count_by_capabilities( &self, capabilities: Vec<Capability>, ) -> Response<usize>
fn target_reached(&self) -> Response<bool>
fn target_peers_reached(&self) -> Response<bool>
fn target_peers_completion(&self) -> Response<f64>
fn get_contact_to_initiate(&self) -> Response<Option<Box<Contact>>>
fn get_contact_for_enr_lookup(&self) -> Response<Option<Box<Contact>>>
fn get_closest_from_pool( &self, target: H256, count: usize, ) -> Response<Vec<(H256, Node)>>
fn get_contact(&self, node_id: H256) -> Response<Option<Box<Contact>>>
fn get_contact_to_revalidate( &self, revalidation_interval: Duration, protocol: DiscoveryProtocol, ) -> Response<Option<Box<Contact>>>
fn get_best_peer( &self, capabilities: Vec<Capability>, ) -> Response<Option<(H256, PeerConnection, RequestPermit)>>
fn get_best_peer_excluding( &self, capabilities: Vec<Capability>, excluded: Vec<H256>, ) -> Response<Option<(H256, PeerConnection, RequestPermit)>>
fn get_best_n_peers( &self, capabilities: Vec<Capability>, n: usize, ) -> Response<Vec<(H256, PeerConnection, RequestPermit)>>
Sourcefn has_eligible_peer(&self, capabilities: Vec<Capability>) -> Response<bool>
fn has_eligible_peer(&self, capabilities: Vec<Capability>) -> Response<bool>
Read-only predicate: is there any eligible peer matching capabilities?
Does not reserve a slot; use for capacity/rotation probes only.
fn get_score(&self, node_id: H256) -> Response<i64>
fn get_connected_nodes(&self) -> Response<Vec<Node>>
fn get_peers_with_capabilities( &self, ) -> Response<Vec<(H256, PeerConnection, Vec<Capability>)>>
fn insert_if_new( &self, node: Node, protocol: DiscoveryProtocol, ) -> Response<bool>
fn validate_contact( &self, node_id: H256, sender_ip: IpAddr, ) -> Response<ContactValidation>
fn get_closest_nodes(&self, node_id: H256) -> Response<Vec<Node>>
fn get_nodes_at_distances( &self, distances: Vec<u32>, ) -> Response<Vec<NodeRecord>>
fn get_peers_data(&self) -> Response<Vec<PeerData>>
fn get_random_peer( &self, capabilities: Vec<Capability>, ) -> Response<Option<(H256, PeerConnection, RequestPermit)>>
fn get_session_info(&self, node_id: H256) -> Response<Option<Session>>
fn get_peer_diagnostics(&self) -> Response<Vec<PeerDiagnostics>>
fn get_peer_connection(&self, peer_id: H256) -> Response<Option<PeerConnection>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<__A: Actor + Handler<NewContacts> + Handler<NewContactRecords> + Handler<NewConnectedPeer> + Handler<SetSessionInfo> + Handler<RemovePeer> + Handler<DecRequests> + Handler<SetUnwanted> + Handler<SetIsForkIdValid> + Handler<RecordSuccess> + Handler<RecordFailure> + Handler<RecordCriticalFailure> + Handler<RecordPingSent> + Handler<RecordPongReceived> + Handler<RecordEnrRequestSent> + Handler<RecordEnrResponseReceived> + Handler<SetDisposable> + Handler<MarkKnowsUs> + Handler<PruneTable> + Handler<Shutdown> + Handler<PeerCount> + Handler<PeerCountByCapabilities> + Handler<TargetReached> + Handler<TargetPeersReached> + Handler<TargetPeersCompletion> + Handler<GetContactToInitiate> + Handler<GetContactForEnrLookup> + Handler<GetClosestFromPool> + Handler<GetContact> + Handler<GetContactToRevalidate> + Handler<GetBestPeer> + Handler<GetBestPeerExcluding> + Handler<GetBestNPeers> + Handler<HasEligiblePeer> + Handler<GetScore> + Handler<GetConnectedNodes> + Handler<GetPeersWithCapabilities> + Handler<InsertIfNew> + Handler<ValidateContact> + Handler<GetClosestNodes> + Handler<GetNodesAtDistances> + Handler<GetPeersData> + Handler<GetRandomPeer> + Handler<GetSessionInfo> + Handler<GetPeerDiagnostics> + Handler<GetPeerConnection>> PeerTableServerProtocol for ActorRef<__A>
impl<__A: Actor + Handler<NewContacts> + Handler<NewContactRecords> + Handler<NewConnectedPeer> + Handler<SetSessionInfo> + Handler<RemovePeer> + Handler<DecRequests> + Handler<SetUnwanted> + Handler<SetIsForkIdValid> + Handler<RecordSuccess> + Handler<RecordFailure> + Handler<RecordCriticalFailure> + Handler<RecordPingSent> + Handler<RecordPongReceived> + Handler<RecordEnrRequestSent> + Handler<RecordEnrResponseReceived> + Handler<SetDisposable> + Handler<MarkKnowsUs> + Handler<PruneTable> + Handler<Shutdown> + Handler<PeerCount> + Handler<PeerCountByCapabilities> + Handler<TargetReached> + Handler<TargetPeersReached> + Handler<TargetPeersCompletion> + Handler<GetContactToInitiate> + Handler<GetContactForEnrLookup> + Handler<GetClosestFromPool> + Handler<GetContact> + Handler<GetContactToRevalidate> + Handler<GetBestPeer> + Handler<GetBestPeerExcluding> + Handler<GetBestNPeers> + Handler<HasEligiblePeer> + Handler<GetScore> + Handler<GetConnectedNodes> + Handler<GetPeersWithCapabilities> + Handler<InsertIfNew> + Handler<ValidateContact> + Handler<GetClosestNodes> + Handler<GetNodesAtDistances> + Handler<GetPeersData> + Handler<GetRandomPeer> + Handler<GetSessionInfo> + Handler<GetPeerDiagnostics> + Handler<GetPeerConnection>> PeerTableServerProtocol for ActorRef<__A>
Source§fn has_eligible_peer(&self, capabilities: Vec<Capability>) -> Response<bool>
fn has_eligible_peer(&self, capabilities: Vec<Capability>) -> Response<bool>
Read-only predicate: is there any eligible peer matching capabilities?
Does not reserve a slot; use for capacity/rotation probes only.
fn new_contacts( &self, nodes: Vec<Node>, protocol: DiscoveryProtocol, ) -> Result<(), ActorError>
fn new_contact_records( &self, node_records: Vec<NodeRecord>, ) -> Result<(), ActorError>
fn new_connected_peer( &self, node: Node, connection: PeerConnection, capabilities: Vec<Capability>, ) -> Result<(), ActorError>
fn set_session_info( &self, node_id: H256, session: Session, ) -> Result<(), ActorError>
fn remove_peer(&self, node_id: H256) -> Result<(), ActorError>
fn dec_requests(&self, node_id: H256) -> Result<(), ActorError>
fn set_unwanted(&self, node_id: H256) -> Result<(), ActorError>
fn set_is_fork_id_valid( &self, node_id: H256, valid: bool, ) -> Result<(), ActorError>
fn record_success(&self, node_id: H256) -> Result<(), ActorError>
fn record_failure(&self, node_id: H256) -> Result<(), ActorError>
fn record_critical_failure(&self, node_id: H256) -> Result<(), ActorError>
fn record_ping_sent( &self, node_id: H256, ping_id: Bytes, ) -> Result<(), ActorError>
fn record_pong_received( &self, node_id: H256, ping_id: Bytes, ) -> Result<(), ActorError>
fn record_enr_request_sent( &self, node_id: H256, request_hash: H256, ) -> Result<(), ActorError>
fn record_enr_response_received( &self, node_id: H256, request_hash: H256, record: NodeRecord, ) -> Result<(), ActorError>
fn set_disposable(&self, node_id: H256) -> Result<(), ActorError>
fn mark_knows_us(&self, node_id: H256) -> Result<(), ActorError>
fn prune_table(&self) -> Result<(), ActorError>
fn shutdown(&self) -> Result<(), ActorError>
fn peer_count(&self) -> Response<usize>
fn peer_count_by_capabilities( &self, capabilities: Vec<Capability>, ) -> Response<usize>
fn target_reached(&self) -> Response<bool>
fn target_peers_reached(&self) -> Response<bool>
fn target_peers_completion(&self) -> Response<f64>
fn get_contact_to_initiate(&self) -> Response<Option<Box<Contact>>>
fn get_contact_for_enr_lookup(&self) -> Response<Option<Box<Contact>>>
fn get_closest_from_pool( &self, target: H256, count: usize, ) -> Response<Vec<(H256, Node)>>
fn get_contact(&self, node_id: H256) -> Response<Option<Box<Contact>>>
fn get_contact_to_revalidate( &self, revalidation_interval: Duration, protocol: DiscoveryProtocol, ) -> Response<Option<Box<Contact>>>
fn get_best_peer( &self, capabilities: Vec<Capability>, ) -> Response<Option<(H256, PeerConnection, RequestPermit)>>
fn get_best_peer_excluding( &self, capabilities: Vec<Capability>, excluded: Vec<H256>, ) -> Response<Option<(H256, PeerConnection, RequestPermit)>>
fn get_best_n_peers( &self, capabilities: Vec<Capability>, n: usize, ) -> Response<Vec<(H256, PeerConnection, RequestPermit)>>
fn get_score(&self, node_id: H256) -> Response<i64>
fn get_connected_nodes(&self) -> Response<Vec<Node>>
fn get_peers_with_capabilities( &self, ) -> Response<Vec<(H256, PeerConnection, Vec<Capability>)>>
fn insert_if_new( &self, node: Node, protocol: DiscoveryProtocol, ) -> Response<bool>
fn validate_contact( &self, node_id: H256, sender_ip: IpAddr, ) -> Response<ContactValidation>
fn get_closest_nodes(&self, node_id: H256) -> Response<Vec<Node>>
fn get_nodes_at_distances( &self, distances: Vec<u32>, ) -> Response<Vec<NodeRecord>>
fn get_peers_data(&self) -> Response<Vec<PeerData>>
fn get_random_peer( &self, capabilities: Vec<Capability>, ) -> Response<Option<(H256, PeerConnection, RequestPermit)>>
fn get_session_info(&self, node_id: H256) -> Response<Option<Session>>
fn get_peer_diagnostics(&self) -> Response<Vec<PeerDiagnostics>>
fn get_peer_connection(&self, peer_id: H256) -> Response<Option<PeerConnection>>
Source§impl<__A: Actor + Handler<NewContacts> + Handler<NewContactRecords> + Handler<NewConnectedPeer> + Handler<SetSessionInfo> + Handler<RemovePeer> + Handler<DecRequests> + Handler<SetUnwanted> + Handler<SetIsForkIdValid> + Handler<RecordSuccess> + Handler<RecordFailure> + Handler<RecordCriticalFailure> + Handler<RecordPingSent> + Handler<RecordPongReceived> + Handler<RecordEnrRequestSent> + Handler<RecordEnrResponseReceived> + Handler<SetDisposable> + Handler<MarkKnowsUs> + Handler<PruneTable> + Handler<Shutdown> + Handler<PeerCount> + Handler<PeerCountByCapabilities> + Handler<TargetReached> + Handler<TargetPeersReached> + Handler<TargetPeersCompletion> + Handler<GetContactToInitiate> + Handler<GetContactForEnrLookup> + Handler<GetClosestFromPool> + Handler<GetContact> + Handler<GetContactToRevalidate> + Handler<GetBestPeer> + Handler<GetBestPeerExcluding> + Handler<GetBestNPeers> + Handler<HasEligiblePeer> + Handler<GetScore> + Handler<GetConnectedNodes> + Handler<GetPeersWithCapabilities> + Handler<InsertIfNew> + Handler<ValidateContact> + Handler<GetClosestNodes> + Handler<GetNodesAtDistances> + Handler<GetPeersData> + Handler<GetRandomPeer> + Handler<GetSessionInfo> + Handler<GetPeerDiagnostics> + Handler<GetPeerConnection>> PeerTableServerProtocol for ActorRef<__A>
impl<__A: Actor + Handler<NewContacts> + Handler<NewContactRecords> + Handler<NewConnectedPeer> + Handler<SetSessionInfo> + Handler<RemovePeer> + Handler<DecRequests> + Handler<SetUnwanted> + Handler<SetIsForkIdValid> + Handler<RecordSuccess> + Handler<RecordFailure> + Handler<RecordCriticalFailure> + Handler<RecordPingSent> + Handler<RecordPongReceived> + Handler<RecordEnrRequestSent> + Handler<RecordEnrResponseReceived> + Handler<SetDisposable> + Handler<MarkKnowsUs> + Handler<PruneTable> + Handler<Shutdown> + Handler<PeerCount> + Handler<PeerCountByCapabilities> + Handler<TargetReached> + Handler<TargetPeersReached> + Handler<TargetPeersCompletion> + Handler<GetContactToInitiate> + Handler<GetContactForEnrLookup> + Handler<GetClosestFromPool> + Handler<GetContact> + Handler<GetContactToRevalidate> + Handler<GetBestPeer> + Handler<GetBestPeerExcluding> + Handler<GetBestNPeers> + Handler<HasEligiblePeer> + Handler<GetScore> + Handler<GetConnectedNodes> + Handler<GetPeersWithCapabilities> + Handler<InsertIfNew> + Handler<ValidateContact> + Handler<GetClosestNodes> + Handler<GetNodesAtDistances> + Handler<GetPeersData> + Handler<GetRandomPeer> + Handler<GetSessionInfo> + Handler<GetPeerDiagnostics> + Handler<GetPeerConnection>> PeerTableServerProtocol for ActorRef<__A>
Source§fn has_eligible_peer(&self, capabilities: Vec<Capability>) -> Response<bool>
fn has_eligible_peer(&self, capabilities: Vec<Capability>) -> Response<bool>
Read-only predicate: is there any eligible peer matching capabilities?
Does not reserve a slot; use for capacity/rotation probes only.