use crate::plumbing;
use crate::plumbing::QueryStorageOps;
use crate::Query;
use crate::QueryTable;
use std::iter::FromIterator;
pub trait DebugQueryTable {
type Key;
fn is_constant(&self, key: Self::Key) -> bool;
fn keys<C>(&self) -> C
where
C: FromIterator<Self::Key>;
}
impl<DB, Q> DebugQueryTable for QueryTable<'_, DB, Q>
where
DB: plumbing::GetQueryTable<Q>,
Q: Query<DB>,
{
type Key = Q::Key;
fn is_constant(&self, key: Q::Key) -> bool {
self.storage.is_constant(self.db, &key)
}
fn keys<C>(&self) -> C
where
C: FromIterator<Q::Key>,
{
self.storage.keys(self.db)
}
}