wip storage integration

This commit is contained in:
Andrew Morris
2023-10-30 17:39:36 +11:00
parent 6fbca5ac59
commit 8bdccba57e
12 changed files with 244 additions and 8 deletions

View File

@@ -136,8 +136,6 @@ impl StorageEntity for DemoVal {
}
fn from_storage_entry<E, Tx: StorageOps<E>>(tx: &mut Tx, entry: StorageEntry) -> Result<Self, E> {
let mut reader = StorageEntryReader::new(&entry);
Self::read_from_entry(tx, &mut reader)
Self::read_from_entry(tx, &mut StorageEntryReader::new(&entry))
}
}

View File

@@ -17,5 +17,7 @@ pub use self::storage::Storage;
pub use self::storage_backend::StorageBackend;
pub use memory_backend::MemoryBackend;
pub use sled_backend::SledBackend;
pub use storage_entity::StorageEntity;
pub use storage_entry::{StorageEntry, StorageEntryReader};
pub use storage_ptr::{storage_head_ptr, StoragePtr};
pub use storage_ops::StorageOps;
pub use storage_ptr::{storage_head_ptr, StorageEntryPtr, StorageHeadPtr, StoragePtr};

View File

@@ -5,8 +5,8 @@ use crate::storage_ptr::StorageEntryPtr;
#[derive(Serialize, Deserialize)]
pub struct StorageEntry {
pub(crate) ref_count: u64,
pub(crate) refs: Vec<StorageEntryPtr>,
pub(crate) data: Vec<u8>,
pub refs: Vec<StorageEntryPtr>,
pub data: Vec<u8>,
}
pub struct StorageEntryReader<'a> {