pub struct VersionHandshake {
pub max_version: u16,
pub min_version: u16,
pub build_id: [u8; 32],
}Expand description
First-frame body each side sends. Carries the peer’s supported version window so the other side can compute the negotiated version (or refuse).
Fields§
§max_version: u16Max protocol version this peer can speak.
min_version: u16Min protocol version this peer understands.
build_id: [u8; 32]Stable build identity — operators read this in sui-daemon status output. Free-form; never load-bearing for negotiation.
Implementations§
Source§impl VersionHandshake
impl VersionHandshake
Sourcepub fn local(build_id: [u8; 32]) -> Self
pub fn local(build_id: [u8; 32]) -> Self
Construct the local side of the handshake using this build’s compile-time version window.
Sourcepub fn negotiate(&self, peer: &VersionHandshake) -> Option<NegotiatedVersion>
pub fn negotiate(&self, peer: &VersionHandshake) -> Option<NegotiatedVersion>
Compute the negotiated version against a peer’s handshake.
§Errors
Returns None when the two windows don’t overlap (peer too
old to talk to us, or we’re too old to talk to them).
Sourcepub fn access(bytes: &[u8]) -> Result<&ArchivedVersionHandshake, Error>
pub fn access(bytes: &[u8]) -> Result<&ArchivedVersionHandshake, Error>
Validate-and-cast helper for callers that just received the archived handshake from the wire. Wraps the rkyv access machinery so call sites don’t reinvent it.
§Errors
Propagates the rkyv validation error verbatim — typically a length/alignment/tag mismatch means the peer isn’t speaking our protocol at all.
Trait Implementations§
Source§impl Archive for VersionHandshake
impl Archive for VersionHandshake
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§type Archived = ArchivedVersionHandshake
type Archived = ArchivedVersionHandshake
Source§type Resolver = VersionHandshakeResolver
type Resolver = VersionHandshakeResolver
Source§impl Clone for VersionHandshake
impl Clone for VersionHandshake
Source§fn clone(&self) -> VersionHandshake
fn clone(&self) -> VersionHandshake
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for VersionHandshake
Source§impl Debug for VersionHandshake
impl Debug for VersionHandshake
Source§impl<__D: Fallible + ?Sized> Deserialize<VersionHandshake, __D> for Archived<VersionHandshake>
impl<__D: Fallible + ?Sized> Deserialize<VersionHandshake, __D> for Archived<VersionHandshake>
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<VersionHandshake, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<VersionHandshake, <__D as Fallible>::Error>
impl Eq for VersionHandshake
Source§impl PartialEq for VersionHandshake
impl PartialEq for VersionHandshake
Source§fn eq(&self, other: &VersionHandshake) -> bool
fn eq(&self, other: &VersionHandshake) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VersionHandshake
Auto Trait Implementations§
impl Freeze for VersionHandshake
impl RefUnwindSafe for VersionHandshake
impl Send for VersionHandshake
impl Sync for VersionHandshake
impl Unpin for VersionHandshake
impl UnsafeUnpin for VersionHandshake
impl UnwindSafe for VersionHandshake
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.