use crate::merkle::{Family, Location};
use commonware_codec::CodecShared;
use core::{fmt::Debug, hash::Hash, ops::Deref};
pub trait Key:
CodecShared + Clone + 'static + Eq + Ord + Hash + AsRef<[u8]> + Deref<Target = [u8]> + Debug
{
}
impl<T> Key for T where
T: CodecShared + Clone + 'static + Eq + Ord + Hash + AsRef<[u8]> + Deref<Target = [u8]> + Debug
{
}
pub trait Operation<F: Family> {
type Key: Key;
fn key(&self) -> Option<&Self::Key>;
fn is_update(&self) -> bool;
fn is_delete(&self) -> bool;
fn has_floor(&self) -> Option<Location<F>>;
}
pub trait Committable {
fn is_commit(&self) -> bool;
}