pub struct ProtocolVersion {
pub major: u32,
pub minor: u32,
}Expand description
DeRec protocol version supported by this SDK.
This type represents the protocol-level version carried in the
DeRecMessage envelope:
protocolVersionMajorprotocolVersionMinor
This is not the same as the Rust crate version, npm package version,
or NuGet package version. Package versions identify SDK releases, while
ProtocolVersion identifies the DeRec wire protocol version expected by
protocol messages.
§Fields
major- Protocol major version.minor- Protocol minor version.
§Compatibility
The compatibility policy associated with protocol major/minor versions is defined by the DeRec protocol specification, not by this helper type.
§Example
use derec_library::protocol_version::ProtocolVersion;
let version = ProtocolVersion::current();
assert!(version.major >= 0);
assert!(version.minor >= 0);Fields§
§major: u32§minor: u32Implementations§
Source§impl ProtocolVersion
impl ProtocolVersion
Sourcepub const fn current() -> Self
pub const fn current() -> Self
Returns the current DeRec protocol version supported by this SDK.
This value corresponds to the protocol version that should be written
into the protocolVersionMajor and protocolVersionMinor fields of
the DeRecMessage envelope.
This function reports the supported protocol version only. It does not expose the crate or package release version.
§Returns
Returns the current ProtocolVersion supported by this SDK.
§Example
use derec_library::protocol_version::ProtocolVersion;
let version = ProtocolVersion::current();
println!("DeRec protocol version: {}.{}", version.major, version.minor);Trait Implementations§
Source§impl Clone for ProtocolVersion
impl Clone for ProtocolVersion
Source§fn clone(&self) -> ProtocolVersion
fn clone(&self) -> ProtocolVersion
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 ProtocolVersion
Source§impl Debug for ProtocolVersion
impl Debug for ProtocolVersion
Source§impl Display for ProtocolVersion
impl Display for ProtocolVersion
impl Eq for ProtocolVersion
Source§impl PartialEq for ProtocolVersion
impl PartialEq for ProtocolVersion
impl StructuralPartialEq for ProtocolVersion
Auto Trait Implementations§
impl Freeze for ProtocolVersion
impl RefUnwindSafe for ProtocolVersion
impl Send for ProtocolVersion
impl Sync for ProtocolVersion
impl Unpin for ProtocolVersion
impl UnsafeUnpin for ProtocolVersion
impl UnwindSafe for ProtocolVersion
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more