pub struct DummyImmutablesDbBuilder { /* private fields */ }
Expand description
A DummyImmutableDb builder.
Implementations§
source§impl DummyImmutablesDbBuilder
impl DummyImmutablesDbBuilder
sourcepub fn new(dir_name: &str) -> Self
pub fn new(dir_name: &str) -> Self
DummyImmutablesDbBuilder 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 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_file_size(&mut self, file_size: u64) -> &mut Self
pub fn set_file_size(&mut self, file_size: u64) -> &mut Self
Set the size of all files written by build to the given file_size
in bytes.
Note: by default the size of the produced files is less than a 1kb.
sourcepub fn build(&self) -> DummyImmutableDb
pub fn build(&self) -> DummyImmutableDb
Build a DummyImmutableDb.
Auto Trait Implementations§
impl Freeze for DummyImmutablesDbBuilder
impl RefUnwindSafe for DummyImmutablesDbBuilder
impl Send for DummyImmutablesDbBuilder
impl Sync for DummyImmutablesDbBuilder
impl Unpin for DummyImmutablesDbBuilder
impl UnwindSafe for DummyImmutablesDbBuilder
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
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>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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