Struct merkletree::store::StoreConfig
source · pub struct StoreConfig {
pub path: PathBuf,
pub id: String,
pub size: Option<usize>,
pub rows_to_discard: usize,
}
Fields§
§path: PathBuf
A directory in which data (a merkle tree) can be persisted.
id: String
A unique identifier used to help specify the on-disk store location for this particular data.
size: Option<usize>
The number of elements in the DiskStore. This field is optional, and unused internally.
rows_to_discard: usize
The number of merkle tree rows_to_discard then cache on disk.
Implementations§
source§impl StoreConfig
impl StoreConfig
pub fn new<T: Into<PathBuf>, S: Into<String>>( path: T, id: S, rows_to_discard: usize, ) -> Self
pub fn default_rows_to_discard(leafs: usize, branches: usize) -> usize
pub fn data_path(path: &Path, id: &str) -> PathBuf
pub fn from_config<S: Into<String>>( config: &StoreConfig, id: S, size: Option<usize>, ) -> Self
Trait Implementations§
source§impl Clone for StoreConfig
impl Clone for StoreConfig
source§fn clone(&self) -> StoreConfig
fn clone(&self) -> StoreConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for StoreConfig
impl Debug for StoreConfig
source§impl Default for StoreConfig
impl Default for StoreConfig
source§fn default() -> StoreConfig
fn default() -> StoreConfig
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for StoreConfig
impl<'de> Deserialize<'de> for StoreConfig
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StoreConfig
impl RefUnwindSafe for StoreConfig
impl Send for StoreConfig
impl Sync for StoreConfig
impl Unpin for StoreConfig
impl UnwindSafe for StoreConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more