pub struct DummyCardanoDbBuilder { /* private fields */ }Expand description
A DummyCardanoDbBuilder builder.
Implementations§
Source§impl DummyCardanoDbBuilder
impl DummyCardanoDbBuilder
Sourcepub fn new(dir_name: &str) -> Self
pub fn new(dir_name: &str) -> Self
DummyCardanoDbBuilder factory, will create a folder with the given dirname in the
system temp directory, if it exists already it will be cleaned.
Sourcepub fn with_immutables(
&mut self,
immutables: &[ImmutableFileNumber],
) -> &mut Self
pub fn with_immutables( &mut self, immutables: &[ImmutableFileNumber], ) -> &mut Self
Set the immutables file number that will be used to generate the immutable files, for each number three files will be generated (a ‘chunk’, a ‘primary’ and a ‘secondary’ file).
Sourcepub fn with_non_immutables(&mut self, non_immutables: &[&str]) -> &mut Self
pub fn with_non_immutables(&mut self, non_immutables: &[&str]) -> &mut Self
Set filenames to write to the db that doesn’t follow the immutable file name scheme.
Sourcepub fn with_legacy_ledger_snapshots(
&mut self,
snapshot_slot_numbers: &[u64],
) -> &mut Self
pub fn with_legacy_ledger_snapshots( &mut self, snapshot_slot_numbers: &[u64], ) -> &mut Self
Set legacy ledger state snapshot slot numbers to write to the db in the ‘ledger’ subdirectory.
Sourcepub fn with_in_memory_ledger_snapshots(
&mut self,
snapshot_slot_numbers: &[u64],
) -> &mut Self
pub fn with_in_memory_ledger_snapshots( &mut self, snapshot_slot_numbers: &[u64], ) -> &mut Self
Set the slot numbers of utxo-hd in-memory snapshot folders to write to the db in the ‘ledger’ subdirectory.
Sourcepub fn with_non_ledger_files(&mut self, files: &[&str]) -> &mut Self
pub fn with_non_ledger_files(&mut self, files: &[&str]) -> &mut Self
Set filenames to write to the ‘ledger’ subdirectory that are not ledger snapshots.
Sourcepub fn set_ledger_file_size(&mut self, file_size: u64) -> &mut Self
pub fn set_ledger_file_size(&mut self, file_size: u64) -> &mut Self
Set the size of all ledger files written by build to the given file_size in bytes.
Note: for types of ledger state snapshots that have more than one file, the size is evenly split across all files:
- Legacy snapshots: not divided as it’s a single file
- In-memory snapshots: divided by three
Sourcepub fn with_volatile_files(&mut self, files: &[&str]) -> &mut Self
pub fn with_volatile_files(&mut self, files: &[&str]) -> &mut Self
Set volatile files to write to the db in the ‘volatile’ subdirectory.
Sourcepub fn set_volatile_file_size(&mut self, file_size: u64) -> &mut Self
pub fn set_volatile_file_size(&mut self, file_size: u64) -> &mut Self
Set the size of all volatile files written by build to the given file_size in bytes.
Sourcepub fn append_immutable_trio(&mut self) -> &mut Self
pub fn append_immutable_trio(&mut self) -> &mut Self
Makes build add another trio of immutables file, that won’t be included in its returned vec, to simulate the last 3 ‘uncompleted / wip’ files that can be found in a cardano immutable db.
Sourcepub fn set_immutable_trio_file_size(&mut self, trio_file_size: u64) -> &mut Self
pub fn set_immutable_trio_file_size(&mut self, trio_file_size: u64) -> &mut Self
Set the size of all immutable files written by build to the given file_size in bytes.
Note: by default, the size of the produced files is less than 1 kb.
Sourcepub fn build(&self) -> DummyCardanoDb
pub fn build(&self) -> DummyCardanoDb
Build a DummyCardanoDb.
Auto Trait Implementations§
impl Freeze for DummyCardanoDbBuilder
impl RefUnwindSafe for DummyCardanoDbBuilder
impl Send for DummyCardanoDbBuilder
impl Sync for DummyCardanoDbBuilder
impl Unpin for DummyCardanoDbBuilder
impl UnsafeUnpin for DummyCardanoDbBuilder
impl UnwindSafe for DummyCardanoDbBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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>
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>
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