[−][src]Trait merkletree::store::Store
Backing store of the merkle tree.
Required methods
fn new_with_config(size: usize, config: StoreConfig) -> Result<Self>
Creates a new store which can store up to size
elements.
fn new(size: usize) -> Result<Self>
fn new_from_slice_with_config(
size: usize,
data: &[u8],
config: StoreConfig
) -> Result<Self>
size: usize,
data: &[u8],
config: StoreConfig
) -> Result<Self>
fn new_from_slice(size: usize, data: &[u8]) -> Result<Self>
fn new_from_disk(size: usize, config: &StoreConfig) -> Result<Self>
fn write_at(&mut self, el: E, index: usize)
fn copy_from_slice(&mut self, buf: &[u8], start: usize)
fn compact(&mut self, config: StoreConfig) -> Result<bool>
fn delete(config: StoreConfig) -> Result<()>
fn read_at(&self, index: usize) -> E
fn read_range(&self, r: Range<usize>) -> Vec<E>
fn read_into(&self, pos: usize, buf: &mut [u8])
fn read_range_into(&self, start: usize, end: usize, buf: &mut [u8])
fn len(&self) -> usize
fn loaded_from_disk(&self) -> bool
fn is_empty(&self) -> bool
fn push(&mut self, el: E)
Provided methods
fn sync(&self)
Implementors
impl<E: Element> Store<E> for DiskStore<E>
[src]
fn new_with_config(size: usize, config: StoreConfig) -> Result<Self>
[src]
fn new(size: usize) -> Result<Self>
[src]
fn new_from_slice_with_config(
size: usize,
data: &[u8],
config: StoreConfig
) -> Result<Self>
[src]
size: usize,
data: &[u8],
config: StoreConfig
) -> Result<Self>
fn new_from_slice(size: usize, data: &[u8]) -> Result<Self>
[src]
fn new_from_disk(size: usize, config: &StoreConfig) -> Result<Self>
[src]
fn write_at(&mut self, el: E, index: usize)
[src]
fn copy_from_slice(&mut self, buf: &[u8], start: usize)
[src]
fn read_at(&self, index: usize) -> E
[src]
fn read_into(&self, index: usize, buf: &mut [u8])
[src]
fn read_range_into(&self, start: usize, end: usize, buf: &mut [u8])
[src]
fn read_range(&self, r: Range<usize>) -> Vec<E>
[src]
fn len(&self) -> usize
[src]
fn loaded_from_disk(&self) -> bool
[src]
fn compact(&mut self, config: StoreConfig) -> Result<bool>
[src]
fn delete(config: StoreConfig) -> Result<()>
[src]
fn is_empty(&self) -> bool
[src]
fn push(&mut self, el: E)
[src]
fn sync(&self)
[src]
impl<E: Element> Store<E> for LevelCacheStore<E>
[src]
fn new_with_config(size: usize, config: StoreConfig) -> Result<Self>
[src]
fn new(_size: usize) -> Result<Self>
[src]
fn new_from_slice_with_config(
_size: usize,
_data: &[u8],
_config: StoreConfig
) -> Result<Self>
[src]
_size: usize,
_data: &[u8],
_config: StoreConfig
) -> Result<Self>
fn new_from_slice(_size: usize, _data: &[u8]) -> Result<Self>
[src]
fn new_from_disk(store_range: usize, config: &StoreConfig) -> Result<Self>
[src]
fn write_at(&mut self, _el: E, _index: usize)
[src]
fn copy_from_slice(&mut self, _buf: &[u8], _start: usize)
[src]
fn read_at(&self, index: usize) -> E
[src]
fn read_into(&self, index: usize, buf: &mut [u8])
[src]
fn read_range_into(&self, start: usize, end: usize, buf: &mut [u8])
[src]
fn read_range(&self, r: Range<usize>) -> Vec<E>
[src]
fn len(&self) -> usize
[src]
fn loaded_from_disk(&self) -> bool
[src]
fn compact(&mut self, _config: StoreConfig) -> Result<bool>
[src]
fn delete(config: StoreConfig) -> Result<()>
[src]
fn is_empty(&self) -> bool
[src]
fn push(&mut self, el: E)
[src]
fn sync(&self)
[src]
impl<E: Element> Store<E> for VecStore<E>
[src]
fn new_with_config(size: usize, _config: StoreConfig) -> Result<Self>
[src]
fn new(size: usize) -> Result<Self>
[src]
fn write_at(&mut self, el: E, index: usize)
[src]
fn copy_from_slice(&mut self, buf: &[u8], start: usize)
[src]
fn new_from_slice_with_config(
size: usize,
data: &[u8],
_config: StoreConfig
) -> Result<Self>
[src]
size: usize,
data: &[u8],
_config: StoreConfig
) -> Result<Self>