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 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§
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.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>,
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
.