pub struct Memory<H>(_);
Expand description
In-memory block store.
Implementations
Trait Implementations
sourceimpl<H: 'static + Copy + Clone + Genesis> Store for Memory<H>
impl<H: 'static + Copy + Clone + Genesis> Store for Memory<H>
sourcefn put<I: Iterator<Item = H>>(&mut self, headers: I) -> Result<Height, Error>
fn put<I: Iterator<Item = H>>(&mut self, headers: I) -> Result<Height, Error>
Append a batch of consecutive block headers to the end of the chain.
sourcefn rollback(&mut self, height: Height) -> Result<(), Error>
fn rollback(&mut self, height: Height) -> Result<(), Error>
Rollback the chain to the given height.
sourcefn iter(&self) -> Box<dyn Iterator<Item = Result<(Height, H), Error>>>
fn iter(&self) -> Box<dyn Iterator<Item = Result<(Height, H), Error>>>
Iterate over all headers in the store.
type Header = H
type Header = H
The type of header used in the store.
Auto Trait Implementations
impl<H> RefUnwindSafe for Memory<H>where
H: RefUnwindSafe,
impl<H> Send for Memory<H>where
H: Send,
impl<H> Sync for Memory<H>where
H: Sync,
impl<H> Unpin for Memory<H>where
H: Unpin,
impl<H> UnwindSafe for Memory<H>where
H: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more