pub struct HandshakeResponse {
pub status: HandshakeStatus,
pub selected: Option<ProtocolId>,
}Expand description
Structured handshake response containing negotiation status and selected protocol.
Fields§
§status: HandshakeStatusResult status of negotiation.
selected: Option<ProtocolId>Mutually selected protocol, if successful.
Implementations§
Source§impl HandshakeResponse
impl HandshakeResponse
Sourcepub fn serialize(&self) -> Result<Vec<u8>, HandshakeError>
pub fn serialize(&self) -> Result<Vec<u8>, HandshakeError>
Serializes the response into wire bytes: [status (1B), selected_proto (4B BE)].
§Errors
Currently infallible for valid status values, but returns HandshakeError
if binary serialization invariants are violated.
Trait Implementations§
Source§impl Clone for HandshakeResponse
impl Clone for HandshakeResponse
Source§impl Debug for HandshakeResponse
impl Debug for HandshakeResponse
impl Eq for HandshakeResponse
Source§impl PartialEq for HandshakeResponse
impl PartialEq for HandshakeResponse
impl StructuralPartialEq for HandshakeResponse
Auto Trait Implementations§
impl Freeze for HandshakeResponse
impl RefUnwindSafe for HandshakeResponse
impl Send for HandshakeResponse
impl Sync for HandshakeResponse
impl Unpin for HandshakeResponse
impl UnsafeUnpin for HandshakeResponse
impl UnwindSafe for HandshakeResponse
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