derive traits for Magic<>
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
use core::fmt::{Debug, Formatter};
|
||||
use crate::{MalformedData, OverTheWire, Reader, Writer};
|
||||
|
||||
|
||||
/// Zero-sized type that is written as a 4-byte magic number used for validation
|
||||
#[derive(
|
||||
Eq, PartialEq,
|
||||
Ord, PartialOrd,
|
||||
Hash, Default,
|
||||
Copy, Clone
|
||||
)]
|
||||
pub struct Magic<const VALUE: u32>;
|
||||
|
||||
impl<const V: u32> OverTheWire for Magic<V> {
|
||||
@@ -24,4 +31,6 @@ impl<const V: u32> OverTheWire for Magic<V> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
impl<const V: u32> Debug for Magic<V> {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { ().fmt(f) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user