pub struct HandshakeProtocol {
peer: Arc<Peer>,
protocols: HashMap<ProtocolID, Version>,
}
Fields§
§peer: Arc<Peer>
§protocols: HashMap<ProtocolID, Version>
Implementations§
Source§impl HandshakeProtocol
impl HandshakeProtocol
pub fn new( peer: Arc<Peer>, protocols: HashMap<ProtocolID, Version>, ) -> Arc<Self>
Sourceasync fn send_vermsg(&self) -> Result<()>
async fn send_vermsg(&self) -> Result<()>
Sends a Version message
Sourceasync fn send_verack(&self, ack: bool) -> Result<()>
async fn send_verack(&self, ack: bool) -> Result<()>
Sends a Verack message
Sourceasync fn validate_version_msg(&self, msg: &NetMsg) -> Result<PeerID>
async fn validate_version_msg(&self, msg: &NetMsg) -> Result<PeerID>
Validates the given version msg
Sourceasync fn validate_verack_msg(&self, msg: &NetMsg) -> Result<PeerID>
async fn validate_verack_msg(&self, msg: &NetMsg) -> Result<PeerID>
Validates the given verack msg
Sourceasync fn protocols_match(
&self,
protocols: &HashMap<ProtocolID, VersionInt>,
) -> Result<()>
async fn protocols_match( &self, protocols: &HashMap<ProtocolID, VersionInt>, ) -> Result<()>
Check if the new connection has compatible protocols.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HandshakeProtocol
impl !RefUnwindSafe for HandshakeProtocol
impl Send for HandshakeProtocol
impl Sync for HandshakeProtocol
impl Unpin for HandshakeProtocol
impl !UnwindSafe for HandshakeProtocol
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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