Struct grin_core::ser::ProtocolVersion [−][src]
pub struct ProtocolVersion(pub u32);
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.
Implementations
impl ProtocolVersion
[src]
impl ProtocolVersion
[src]pub fn value(self) -> u32
[src]
pub fn value(self) -> u32
[src]Protocol version as u32 to allow for convenient exhaustive matching on values.
pub fn local() -> ProtocolVersion
[src]
pub fn local() -> ProtocolVersion
[src]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.
pub fn local_db() -> ProtocolVersion
[src]
pub fn local_db() -> ProtocolVersion
[src]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
impl Clone for ProtocolVersion
[src]
impl Clone for ProtocolVersion
[src]fn clone(&self) -> ProtocolVersion
[src]
fn clone(&self) -> ProtocolVersion
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for ProtocolVersion
[src]
impl Debug for ProtocolVersion
[src]impl<'de> Deserialize<'de> for ProtocolVersion
[src]
impl<'de> Deserialize<'de> for ProtocolVersion
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl Display for ProtocolVersion
[src]
impl Display for ProtocolVersion
[src]impl Ord for ProtocolVersion
[src]
impl Ord for ProtocolVersion
[src]impl PartialEq<ProtocolVersion> for ProtocolVersion
[src]
impl PartialEq<ProtocolVersion> for ProtocolVersion
[src]fn eq(&self, other: &ProtocolVersion) -> bool
[src]
fn eq(&self, other: &ProtocolVersion) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &ProtocolVersion) -> bool
[src]
fn ne(&self, other: &ProtocolVersion) -> bool
[src]This method tests for !=
.
impl PartialOrd<ProtocolVersion> for ProtocolVersion
[src]
impl PartialOrd<ProtocolVersion> for ProtocolVersion
[src]fn partial_cmp(&self, other: &ProtocolVersion) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &ProtocolVersion) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Readable for ProtocolVersion
[src]
impl Readable for ProtocolVersion
[src]impl Serialize for ProtocolVersion
[src]
impl Serialize for ProtocolVersion
[src]impl Writeable for ProtocolVersion
[src]
impl Writeable for ProtocolVersion
[src]impl Copy for ProtocolVersion
[src]
impl Eq for ProtocolVersion
[src]
impl StructuralEq for ProtocolVersion
[src]
impl StructuralPartialEq for ProtocolVersion
[src]
Auto Trait Implementations
impl RefUnwindSafe for ProtocolVersion
impl Send for ProtocolVersion
impl Sync for ProtocolVersion
impl Unpin for ProtocolVersion
impl UnwindSafe for ProtocolVersion
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> CloneAny for T where
T: Any + Clone,
impl<T> CloneAny for T where
T: Any + Clone,
pub fn clone_any(&self) -> Box<dyn CloneAny + 'static, Global>
pub fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send, Global> where
T: Send,
T: Send,
pub fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync, Global> where
T: Sync,
T: Sync,
pub fn clone_any_send_sync(
&self
) -> Box<dyn CloneAny + 'static + Sync + Send, Global> where
T: Send + Sync,
&self
) -> Box<dyn CloneAny + 'static + Sync + Send, Global> where
T: Send + Sync,
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DebugAny for T where
T: Any + Debug,
T: Any + Debug,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> UnsafeAny for T where
T: Any,
T: Any,