pub enum AddressBookRequest<Z: NetworkZone> {
Show 14 variants
NewConnection {
internal_peer_id: InternalPeerID<Z::Addr>,
public_address: Option<Z::Addr>,
handle: ConnectionHandle,
id: u64,
pruning_seed: PruningSeed,
rpc_port: u16,
rpc_credits_per_hash: u32,
},
IncomingPeerList(InternalPeerID<Z::Addr>, Vec<ZoneSpecificPeerListEntryBase<Z::Addr>>),
TakeRandomWhitePeer {
height: Option<usize>,
},
TakeRandomGrayPeer {
height: Option<usize>,
},
TakeRandomPeer {
height: Option<usize>,
},
GetWhitePeers(usize),
OwnAddress,
Peerlist,
PeerlistSize,
ConnectionInfo,
ConnectionCount,
SetBan(SetBan<Z::Addr>),
GetBan(Z::Addr),
GetBans,
}Expand description
A request to the address book service.
Variants§
NewConnection
Tells the address book that we have connected or received a connection from a peer.
Fields
internal_peer_id: InternalPeerID<Z::Addr>The InternalPeerID of this connection.
public_address: Option<Z::Addr>The public address of the peer, if this peer has a reachable public address.
handle: ConnectionHandleThe ConnectionHandle to this peer.
pruning_seed: PruningSeedThe peers [PruningSeed].
IncomingPeerList(InternalPeerID<Z::Addr>, Vec<ZoneSpecificPeerListEntryBase<Z::Addr>>)
Tells the address book about a peer list received from a peer.
TakeRandomWhitePeer
Takes a random white peer from the peer list. If height is specified then the peer list should retrieve a peer that should have a full block at that height according to it’s pruning seed
TakeRandomGrayPeer
Takes a random gray peer from the peer list. If height is specified then the peer list should retrieve a peer that should have a full block at that height according to it’s pruning seed
TakeRandomPeer
Takes a random peer from the peer list. If height is specified then the peer list should retrieve a peer that should have a full block at that height according to it’s pruning seed.
The address book will look in the white peer list first, then the gray one if no peer is found.
GetWhitePeers(usize)
Gets the specified number of white peers, or less if we don’t have enough.
OwnAddress
Gets our own optionally specified address
Peerlist
Get info on all peers, white & grey.
PeerlistSize
Get the amount of white & grey peers.
ConnectionInfo
Get information on all connections.
ConnectionCount
Get the amount of incoming & outgoing connections.
SetBan(SetBan<Z::Addr>)
(Un)ban a peer.
GetBan(Z::Addr)
Checks if the given peer is banned.
GetBans
Get the state of all bans.
Trait Implementations§
Source§impl<N: NetworkZone> Service<AddressBookRequest<N>> for DummyAddressBook
impl<N: NetworkZone> Service<AddressBookRequest<N>> for DummyAddressBook
Source§type Response = AddressBookResponse<N>
type Response = AddressBookResponse<N>
Source§type Future = Ready<Result<<DummyAddressBook as Service<AddressBookRequest<N>>>::Response, <DummyAddressBook as Service<AddressBookRequest<N>>>::Error>>
type Future = Ready<Result<<DummyAddressBook as Service<AddressBookRequest<N>>>::Response, <DummyAddressBook as Service<AddressBookRequest<N>>>::Error>>
Source§fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Poll::Ready(Ok(())) when the service is able to process requests. Read moreSource§fn call(&mut self, req: AddressBookRequest<N>) -> Self::Future
fn call(&mut self, req: AddressBookRequest<N>) -> Self::Future
Auto Trait Implementations§
impl<Z> Freeze for AddressBookRequest<Z>
impl<Z> RefUnwindSafe for AddressBookRequest<Z>
impl<Z> Send for AddressBookRequest<Z>
impl<Z> Sync for AddressBookRequest<Z>
impl<Z> Unpin for AddressBookRequest<Z>
impl<Z> UnsafeUnpin for AddressBookRequest<Z>
impl<Z> UnwindSafe for AddressBookRequest<Z>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.