use speedy::{ Readable, Writable };

use crate::Toc;

#[cfg_attr(feature = "speedy", derive(Readable, Writable))]
#[cfg_attr(any(feature = "bincode", feature = "json"), derive(Deserialize, Serialize))]
#[derive(Debug, Clone, PartialEq)]
pub struct WalkEntry {
    pub path: String,
    pub toc: Toc,
}

#[cfg_attr(feature = "speedy", derive(Readable, Writable))]
#[cfg_attr(any(feature = "bincode", feature = "json"), derive(Deserialize, Serialize))]
#[derive(Debug, Clone, PartialEq)]
pub struct WalkEntryExt {
    pub path: String,
    pub toc: Toc,
}

#[derive(Debug, Clone)]
pub enum WalkResult {
    Toc(Toc),
    WalkEntry(WalkEntry),
    WalkEntryExt(WalkEntryExt),
}
