eryon-mem 0.0.4

this crate implements the memory-related aspects of the eryon framework
/*
    appellation: block <module>
    authors: @FL03
*/

mod impl_block;
mod impl_block_header;

use scsys::{Id, Timestamp};

/// A [`Block`] is a fundamental unit of data within a blockchain, containing a header that
/// includes metadata such as the block's id, timestamp, and previous hash.
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[cfg_attr(
    feature = "serde",
    derive(serde_derive::Deserialize, serde_derive::Serialize),
    serde(rename_all = "snake_case")
)]
#[repr(C)]
pub struct Block {
    pub(crate) header: BlockHeader,
}

/// The [`BlockHeader`] struct contains metadata about a block, including its unique identifier
/// and the timestamp of its creation.
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[cfg_attr(
    feature = "serde",
    derive(serde_derive::Deserialize, serde_derive::Serialize),
    serde(rename_all = "snake_case")
)]
#[repr(C)]
pub struct BlockHeader {
    pub(crate) id: Id,
    pub(crate) timestamp: Timestamp,
}