Add missing derives to newtypes.
This commit is contained in:
parent
32cf74db39
commit
733d090b9b
|
@ -16,11 +16,14 @@ impl<'a> From<&'a [u8]> for Sha256dChecksum {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A u32 which represents a block height value.
|
/// A u32 which represents a block height value.
|
||||||
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
pub struct BlockHeight(pub u32);
|
pub struct BlockHeight(pub u32);
|
||||||
|
|
||||||
/// InventoryType
|
/// InventoryType
|
||||||
///
|
///
|
||||||
/// [Bitcoin·reference](https://en.bitcoin.it/wiki/Protocol_documentation#Inventory_Vectors)
|
/// [Bitcoin·reference](https://en.bitcoin.it/wiki/Protocol_documentation#Inventory_Vectors)
|
||||||
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
|
#[repr(u8)]
|
||||||
pub enum InventoryType {
|
pub enum InventoryType {
|
||||||
/// Any data of with this number may be ignored.
|
/// Any data of with this number may be ignored.
|
||||||
Error = 0x00,
|
Error = 0x00,
|
||||||
|
@ -48,6 +51,7 @@ pub enum InventoryType {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inventory Vector
|
/// Inventory Vector
|
||||||
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
pub struct InventoryVector(pub InventoryType, pub [u8; 32]);
|
pub struct InventoryVector(pub InventoryType, pub [u8; 32]);
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
|
@ -37,6 +37,7 @@ use crate::types::*;
|
||||||
// the serialized message data and the internal representation. Note that this
|
// the serialized message data and the internal representation. Note that this
|
||||||
// is different from messages like GetAddr which have no data (and so have no
|
// is different from messages like GetAddr which have no data (and so have no
|
||||||
// fields).
|
// fields).
|
||||||
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
pub enum Message {
|
pub enum Message {
|
||||||
/// A `version` message.
|
/// A `version` message.
|
||||||
///
|
///
|
||||||
|
@ -245,6 +246,7 @@ pub enum Message {
|
||||||
/// Reject Reason CCodes
|
/// Reject Reason CCodes
|
||||||
///
|
///
|
||||||
/// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#reject)
|
/// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#reject)
|
||||||
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub enum RejectReason {
|
pub enum RejectReason {
|
||||||
|
|
|
@ -8,6 +8,7 @@ use crate::types::Services;
|
||||||
/// An address with metadata on its advertised services and last-seen time.
|
/// An address with metadata on its advertised services and last-seen time.
|
||||||
///
|
///
|
||||||
/// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#Network_address)
|
/// [Bitcoin reference](https://en.bitcoin.it/wiki/Protocol_documentation#Network_address)
|
||||||
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
pub struct MetaAddr {
|
pub struct MetaAddr {
|
||||||
/// The peer's address.
|
/// The peer's address.
|
||||||
pub addr: SocketAddr,
|
pub addr: SocketAddr,
|
||||||
|
|
Loading…
Reference in New Issue