Struct sp_state_machine::TrieBackendBuilder
source · pub struct TrieBackendBuilder<S: TrieBackendStorage<H>, H: Hasher, C = LocalTrieCache<H>> { /* private fields */ }
Expand description
Builder for creating a TrieBackend
.
Implementations§
source§impl<S, H> TrieBackendBuilder<S, H, LocalTrieCache<H>>where
S: TrieBackendStorage<H>,
H: Hasher,
impl<S, H> TrieBackendBuilder<S, H, LocalTrieCache<H>>where S: TrieBackendStorage<H>, H: Hasher,
source§impl<S, H, C> TrieBackendBuilder<S, H, C>where
S: TrieBackendStorage<H>,
H: Hasher,
impl<S, H, C> TrieBackendBuilder<S, H, C>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>) -> TrieBackendBuilder<&S, H, &C>
pub fn wrap(other: &TrieBackend<S, H, C>) -> TrieBackendBuilder<&S, H, &C>
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<Recorder<H>>) -> Self
pub fn with_optional_recorder(self, recorder: Option<Recorder<H>>) -> Self
Use the given optional recorder
for the to be configured TrieBackend
.
sourcepub fn with_recorder(self, recorder: Recorder<H>) -> Self
pub fn with_recorder(self, recorder: Recorder<H>) -> 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>
pub fn with_optional_cache<LC>( self, cache: Option<LC> ) -> TrieBackendBuilder<S, H, LC>
Use the given optional cache
for the to be configured TrieBackend
.
sourcepub fn with_cache<LC>(self, cache: LC) -> TrieBackendBuilder<S, H, LC>
pub fn with_cache<LC>(self, cache: LC) -> TrieBackendBuilder<S, H, LC>
Use the given cache
for the to be configured TrieBackend
.
sourcepub fn build(self) -> TrieBackend<S, H, C>
pub fn build(self) -> TrieBackend<S, H, C>
Build the configured TrieBackend
.
Auto Trait Implementations§
impl<S, H, C = LocalTrieCache<H>> !RefUnwindSafe for TrieBackendBuilder<S, H, C>
impl<S, H, C> Send for TrieBackendBuilder<S, H, C>where C: Send,
impl<S, H, C> Sync for TrieBackendBuilder<S, H, C>where C: Sync,
impl<S, H, C> Unpin for TrieBackendBuilder<S, H, C>where C: Unpin, S: Unpin, <H as Hasher>::Out: Unpin,
impl<S, H, C = LocalTrieCache<H>> !UnwindSafe for TrieBackendBuilder<S, H, C>
Blanket Implementations§
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, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable 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
.