use crate::{ByteNum, TreeNode};
use bytes::Bytes;
pub mod error;
#[cfg(feature = "tokio_fsm")]
pub mod fsm;
pub mod sync;
#[derive(Debug)]
pub enum DecodeResponseItem {
    Header(Header),
    Parent(Parent),
    Leaf(Leaf),
}
impl From<Header> for DecodeResponseItem {
    fn from(h: Header) -> Self {
        Self::Header(h)
    }
}
impl From<Parent> for DecodeResponseItem {
    fn from(p: Parent) -> Self {
        Self::Parent(p)
    }
}
impl From<Leaf> for DecodeResponseItem {
    fn from(l: Leaf) -> Self {
        Self::Leaf(l)
    }
}
#[derive(Debug)]
pub struct Header {
    pub size: ByteNum,
}
#[derive(Debug)]
pub struct Parent {
    pub node: TreeNode,
    pub pair: (blake3::Hash, blake3::Hash),
}
#[derive(Debug)]
pub struct Leaf {
    pub offset: ByteNum,
    pub data: Bytes,
}