use std::fmt::Debug;
use namada_core::borsh::BorshDeserialize;
use thiserror::Error;
pub mod lazy_map;
pub mod lazy_set;
pub mod lazy_vec;
pub use lazy_map::LazyMap;
pub use lazy_set::LazySet;
pub use lazy_vec::LazyVec;
use namada_core::storage;
#[allow(missing_docs)]
#[derive(Error, Debug)]
pub enum ReadError {
#[error("A storage key was unexpectedly empty")]
UnexpectedlyEmptyStorageKey,
}
#[derive(Debug)]
pub struct Simple;
#[derive(Debug)]
pub struct Nested;
pub trait LazyCollection {
type SubKey: Debug;
type Value: BorshDeserialize + Debug;
fn open(key: storage::Key) -> Self;
fn is_valid_sub_key(
&self,
key: &storage::Key,
) -> crate::Result<Option<Self::SubKey>>;
fn is_data_sub_key(&self, key: &storage::Key) -> bool;
}