(&self, expected: &NetHandshake)
| 74 | |
| 75 | Ok(Self { |
| 76 | app, |
| 77 | protocol, |
| 78 | version, |
| 79 | }) |
| 80 | } |
| 81 | |
| 82 | pub fn validate(&self, expected: &NetHandshake) -> NetResult<()> { |
| 83 | if self == expected { |
| 84 | return Ok(()); |
| 85 | } |
| 86 | Err(NetError::new( |
| 87 | NetErrorKind::Handshake, |
| 88 | format!( |
| 89 | "handshake mismatch: got {}/{}/{}, expected {}/{}/{}", |
| 90 | self.app, |
| 91 | self.protocol, |
| 92 | self.version, |
| 93 | expected.app, |
| 94 | expected.protocol, |
| 95 | expected.version |
no outgoing calls