Struct ethcore::snapshot::StateRebuilder
source · [−]pub struct StateRebuilder { /* private fields */ }
Expand description
Used to rebuild the state trie piece by piece.
Implementations
sourceimpl StateRebuilder
impl StateRebuilder
sourcepub fn new(db: Arc<dyn KeyValueDB>, pruning: Algorithm) -> Self
pub fn new(db: Arc<dyn KeyValueDB>, pruning: Algorithm) -> Self
Create a new state rebuilder to write into the given backing DB.
sourcepub fn feed(&mut self, chunk: &[u8], flag: &AtomicBool) -> Result<(), Error>
pub fn feed(&mut self, chunk: &[u8], flag: &AtomicBool) -> Result<(), Error>
Feed an uncompressed state chunk into the rebuilder.
sourcepub fn finalize(self, era: u64, id: H256) -> Result<Box<dyn JournalDB>, Error>
pub fn finalize(self, era: u64, id: H256) -> Result<Box<dyn JournalDB>, Error>
Finalize the restoration. Check for accounts missing code and make a dummy journal entry. Once all chunks have been fed, there should be nothing missing.
sourcepub fn state_root(&self) -> H256
pub fn state_root(&self) -> H256
Get the state root of the rebuilder.
Auto Trait Implementations
impl !RefUnwindSafe for StateRebuilder
impl Send for StateRebuilder
impl Sync for StateRebuilder
impl Unpin for StateRebuilder
impl !UnwindSafe for StateRebuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more