Struct grin_core::ser::ProtocolVersion
source · pub struct ProtocolVersion(pub u32);
Expand description
Protocol version for serialization/deserialization. Note: This is used in various places including but limited to the p2p layer and our local db storage layer. We may speak multiple versions to various peers and a potentially different version for our local db.
Tuple Fields§
§0: u32
Implementations§
source§impl ProtocolVersion
impl ProtocolVersion
sourcepub fn value(self) -> u32
pub fn value(self) -> u32
Protocol version as u32 to allow for convenient exhaustive matching on values.
sourcepub fn local() -> ProtocolVersion
pub fn local() -> ProtocolVersion
Our default “local” protocol version. This protocol version is provided to peers as part of the Hand/Shake negotiation in the p2p layer. Connected peers will negotiate a suitable protocol version for serialization/deserialization of p2p messages.
sourcepub fn local_db() -> ProtocolVersion
pub fn local_db() -> ProtocolVersion
We need to specify a protocol version for our local database. Regardless of specific version used when sending/receiving data between peers we need to take care with serialization/deserialization of data locally in the db.
Trait Implementations§
source§impl Clone for ProtocolVersion
impl Clone for ProtocolVersion
source§fn clone(&self) -> ProtocolVersion
fn clone(&self) -> ProtocolVersion
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ProtocolVersion
impl Debug for ProtocolVersion
source§impl<'de> Deserialize<'de> for ProtocolVersion
impl<'de> Deserialize<'de> for ProtocolVersion
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for ProtocolVersion
impl Display for ProtocolVersion
source§impl From<ProtocolVersion> for u32
impl From<ProtocolVersion> for u32
source§fn from(v: ProtocolVersion) -> u32
fn from(v: ProtocolVersion) -> u32
source§impl Ord for ProtocolVersion
impl Ord for ProtocolVersion
source§fn cmp(&self, other: &ProtocolVersion) -> Ordering
fn cmp(&self, other: &ProtocolVersion) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for ProtocolVersion
impl PartialEq for ProtocolVersion
source§fn eq(&self, other: &ProtocolVersion) -> bool
fn eq(&self, other: &ProtocolVersion) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ProtocolVersion
impl PartialOrd for ProtocolVersion
source§fn partial_cmp(&self, other: &ProtocolVersion) -> Option<Ordering>
fn partial_cmp(&self, other: &ProtocolVersion) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Readable for ProtocolVersion
impl Readable for ProtocolVersion
source§impl Serialize for ProtocolVersion
impl Serialize for ProtocolVersion
source§impl Writeable for ProtocolVersion
impl Writeable for ProtocolVersion
impl Copy for ProtocolVersion
impl Eq 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 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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.