pub struct Recorder<H: Hasher> { /* private fields */ }
Expand description
The trie recorder.
It can be used to record accesses to the trie and then to convert them into a StorageProof
.
Implementations§
source§impl<H: Hasher> Recorder<H>
impl<H: Hasher> Recorder<H>
sourcepub fn as_trie_recorder(
&self,
storage_root: H::Out
) -> impl TrieRecorder<H::Out> + '_
pub fn as_trie_recorder( &self, storage_root: H::Out ) -> impl TrieRecorder<H::Out> + '_
Returns the recorder as TrieRecorder
compatible type.
storage_root
: The storage root of the trie for which accesses are recorded. This is important when recording access to different tries at once (like top and child tries).
sourcepub fn drain_storage_proof(self) -> StorageProof
pub fn drain_storage_proof(self) -> StorageProof
Drain the recording into a StorageProof
.
While a recorder can be cloned, all share the same internal state. After calling this function, all other instances will have their internal state reset as well.
If you don’t want to drain the recorded state, use Self::to_storage_proof
.
Returns the StorageProof
.
sourcepub fn to_storage_proof(&self) -> StorageProof
pub fn to_storage_proof(&self) -> StorageProof
Convert the recording to a StorageProof
.
In contrast to Self::drain_storage_proof
this doesn’t consumes and doesn’t clears the
recordings.
Returns the StorageProof
.
sourcepub fn estimate_encoded_size(&self) -> usize
pub fn estimate_encoded_size(&self) -> usize
Returns the estimated encoded size of the proof.
The estimation is based on all the nodes that were accessed until now while accessing the trie.
Trait Implementations§
Auto Trait Implementations§
impl<H> !RefUnwindSafe for Recorder<H>
impl<H> Send for Recorder<H>
impl<H> Sync for Recorder<H>
impl<H> Unpin for Recorder<H>
impl<H> !UnwindSafe for Recorder<H>
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>
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>
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)
&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)
&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
unchecked_from
.