use crate::agnostic::Clump;
pub mod phantoms;
use phantoms::PhantomDirectory;
pub trait Entity<C: Clump, D> {
fn is_clump(&self) -> bool;
fn take_clump(&self) -> Option<&C>;
fn is_dir(&self) -> bool;
fn take_dir(&self) -> Option<&D>;
}
impl<C: Clump> Entity<C, PhantomDirectory> for C {
fn is_clump(&self) -> bool {
true
}
fn take_clump(&self) -> Option<&C> {
Some(self)
}
fn is_dir(&self) -> bool {
false
}
fn take_dir(&self) -> Option<&PhantomDirectory> {
None::<&PhantomDirectory>
}
}