Struct sp_state_machine::TrieBackendBuilder
source · pub struct TrieBackendBuilder<S: TrieBackendStorage<H>, H: Hasher, C = LocalTrieCache<H>, R = Recorder<H>> { /* private fields */ }
Expand description
Builder for creating a TrieBackend
.
Implementations§
source§impl<S, H> TrieBackendBuilder<S, H>where
S: TrieBackendStorage<H>,
H: Hasher,
impl<S, H> TrieBackendBuilder<S, H>where
S: TrieBackendStorage<H>,
H: Hasher,
source§impl<S, H, C, R> TrieBackendBuilder<S, H, C, R>where
S: TrieBackendStorage<H>,
H: Hasher,
impl<S, H, C, R> TrieBackendBuilder<S, H, C, R>where
S: TrieBackendStorage<H>,
H: Hasher,
sourcepub fn new_with_cache(storage: S, root: H::Out, cache: C) -> Self
pub fn new_with_cache(storage: S, root: H::Out, cache: C) -> Self
Create a new builder instance.
sourcepub fn wrap(other: &TrieBackend<S, H, C, R>) -> TrieBackendBuilder<&S, H, &C, R>
pub fn wrap(other: &TrieBackend<S, H, C, R>) -> TrieBackendBuilder<&S, H, &C, R>
Wrap the given TrieBackend
.
This can be used for example if all accesses to the trie should be recorded while some other functionality still uses the non-recording backend.
The backend storage and the cache will be taken from other
.
sourcepub fn with_optional_recorder(self, recorder: Option<R>) -> Self
pub fn with_optional_recorder(self, recorder: Option<R>) -> Self
Use the given optional recorder
for the to be configured TrieBackend
.
sourcepub fn with_recorder(self, recorder: R) -> Self
pub fn with_recorder(self, recorder: R) -> Self
Use the given recorder
for the to be configured TrieBackend
.
sourcepub fn with_optional_cache<LC>(
self,
cache: Option<LC>,
) -> TrieBackendBuilder<S, H, LC, R>
pub fn with_optional_cache<LC>( self, cache: Option<LC>, ) -> TrieBackendBuilder<S, H, LC, R>
Use the given optional cache
for the to be configured TrieBackend
.
sourcepub fn with_cache<LC>(self, cache: LC) -> TrieBackendBuilder<S, H, LC, R>
pub fn with_cache<LC>(self, cache: LC) -> TrieBackendBuilder<S, H, LC, R>
Use the given cache
for the to be configured TrieBackend
.
sourcepub fn build(self) -> TrieBackend<S, H, C, R>
pub fn build(self) -> TrieBackend<S, H, C, R>
Build the configured TrieBackend
.
Auto Trait Implementations§
impl<S, H, C, R> Freeze for TrieBackendBuilder<S, H, C, R>
impl<S, H, C, R> RefUnwindSafe for TrieBackendBuilder<S, H, C, R>
impl<S, H, C, R> Send for TrieBackendBuilder<S, H, C, R>
impl<S, H, C, R> Sync for TrieBackendBuilder<S, H, C, R>
impl<S, H, C, R> Unpin for TrieBackendBuilder<S, H, C, R>
impl<S, H, C, R> UnwindSafe for TrieBackendBuilder<S, H, C, R>
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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>
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 moresource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.