[−][src]Struct networking::Peer
A tower::Service
representing an individual peer.
Relies on a backing NodeDataStore
Service
to obtain block and transaction information.
If the NodeDataStore
polls unready, this information will be propagated to the ConnectionManager
struct, which may drop the the corresponding peer
to relieve backpressure.
Implementations
impl Peer
[src]
pub async fn at_address(
id: usize,
address: SocketAddr,
config: Arc<Config>
) -> Result<Peer, PeerError>
[src]
id: usize,
address: SocketAddr,
config: Arc<Config>
) -> Result<Peer, PeerError>
pub async fn from_connection(
id: usize,
connection: TcpStream,
config: Arc<Config>
) -> Peer
[src]
id: usize,
connection: TcpStream,
config: Arc<Config>
) -> Peer
pub async fn send<'_>(&'_ mut self, msg: Message) -> Result<(), PeerError>
[src]
pub fn get_ip_address(&self) -> SocketAddr
[src]
pub fn get_daemon_address(&self) -> SocketAddr
[src]
pub fn get_best_block(&self) -> u32
[src]
pub async fn receive<'_>(
&'_ mut self,
_timeout_duration: Option<Duration>
) -> Result<Message, PeerError>
[src]
&'_ mut self,
_timeout_duration: Option<Duration>
) -> Result<Message, PeerError>
pub async fn receive_expected<'_>(
&'_ mut self,
expected: Command,
timeout_duration: Option<Duration>
) -> Result<Message, PeerError>
[src]
&'_ mut self,
expected: Command,
timeout_duration: Option<Duration>
) -> Result<Message, PeerError>
pub async fn perform_handshake<'_>(
&'_ mut self,
best_block: Option<u32>
) -> Result<(), PeerError>
[src]
&'_ mut self,
best_block: Option<u32>
) -> Result<(), PeerError>
pub async fn accept_handshake<'_>(
&'_ mut self,
best_block: Option<u32>
) -> Result<(), PeerError>
[src]
&'_ mut self,
best_block: Option<u32>
) -> Result<(), PeerError>
pub fn create_version_msg(&self, best_block: Option<u32>) -> Message
[src]
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Peer
impl Send for Peer
impl Sync for Peer
impl Unpin for Peer
impl !UnwindSafe for Peer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,