pub struct Handshake {
pub addrs: Arc<RwLock<VecDeque<PeerAddr>>>,
/* private fields */
}
Expand description
Handles the handshake negotiation when two peers connect and decides on protocol.
Fields§
§addrs: Arc<RwLock<VecDeque<PeerAddr>>>
Ring buffer of self addr(s) collected from PeerWithSelf detection (by nonce).
Implementations§
source§impl Handshake
impl Handshake
pub fn initiate( &self, capabilities: Capabilities, total_difficulty: Difficulty, self_addr: PeerAddr, conn: &mut TcpStream ) -> Result<PeerInfo, Error>
pub fn accept( &self, capab: Capabilities, total_difficulty: Difficulty, conn: &mut TcpStream ) -> Result<PeerInfo, Error>
Auto Trait Implementations§
impl Freeze for Handshake
impl !RefUnwindSafe for Handshake
impl Send for Handshake
impl Sync for Handshake
impl Unpin for Handshake
impl !UnwindSafe for Handshake
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