/// [`AsyncDatabase`](crate::AsyncDatabase) and [`Database`] can be converted to and from each other
/// In this example, `BlogPost` implements the [`Collection`](schema::Collection) trait, and all
fn for_each_in_view<F: FnMut(ViewEntry) -> Result<(), bonsaidb_core::Error> + Send + Sync>(
fn open_trees_for_transaction(&self, transaction: &Transaction) -> Result<OpenTrees, Error> {
pub(crate) fn collection_encryption_key(&self, collection: &CollectionName) -> Option<&KeyId> {
pub fn into_async_with_runtime(self, runtime: tokio::runtime::Handle) -> crate::AsyncDatabase {
pub(crate) fn deserialize_document(bytes: &[u8]) -> Result<BorrowedDocument<'_>, Error> {
fn serialize_document(document: &BorrowedDocument<'_>) -> Result<Vec<u8>, bonsaidb_core::Error> {
.tree(self.collection_tree::<Versioned, _>(collection, document_tree_name(collection))?)
let view = self.schematic().view_by_name(view).unwrap(); // query() will fail if it's not present