feeless 0.1.11

A Nano (cryptocurrency) node and utilities such as nano addresses, hashing blocks, signing, etc.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::fmt::Debug;

use crate::node::header::Header;

pub trait Wire: Debug {
    fn serialize(&self) -> Vec<u8>;

    /// `header` will be `None` when we're deserializing the header itself.
    fn deserialize(header: Option<&Header>, data: &[u8]) -> anyhow::Result<Self>
    where
        Self: Sized;

    /// The expected size of the incoming data.
    fn len(header: Option<&Header>) -> anyhow::Result<usize>
    where
        Self: Sized;
}