pub struct MemoryStore { /* private fields */ }Expand description
メモリの中だけの保存。全部をメモリに持つので、小さいネットワークかテスト向け
Implementations§
Trait Implementations§
Source§impl ChainStore for MemoryStore
impl ChainStore for MemoryStore
Source§async fn load_state(
&self,
) -> Result<(Vec<u8>, Vec<StateRow>, Vec<StateRow>), ChainError>
async fn load_state( &self, ) -> Result<(Vec<u8>, Vec<StateRow>, Vec<StateRow>), ChainError>
実行の状態(木に入らないもの)、状態の行、木のノード。始めるときと、巻き戻しに失敗して読み直すときに使う
Source§async fn load_partial_state(
&self,
) -> Result<(Vec<u8>, Vec<StateRow>, Vec<StateRow>), ChainError>
async fn load_partial_state( &self, ) -> Result<(Vec<u8>, Vec<StateRow>, Vec<StateRow>), ChainError>
ChainStore::load_state の、アカウントの行を除いたもの。アカウントを全部はメモリに持たないときに使うasync fn block(&self, height: u64) -> Result<Option<Vec<u8>>, ChainError>
Source§async fn blocks_from(&self) -> Result<u64, ChainError>
async fn blocks_from(&self) -> Result<u64, ChainError>
残っている一番低いブロックの高さ(刈り込んでいなければ 0)
async fn proof(&self, epoch: u32) -> Result<Option<Vec<u8>>, ChainError>
Source§async fn proofs_tip(&self) -> Result<u32, ChainError>
async fn proofs_tip(&self) -> Result<u32, ChainError>
しまった一番新しい証明のエポック(なければ 0)
async fn voters(&self, epoch: u32) -> Result<Option<Vec<u8>>, ChainError>
async fn put_proof(&self, epoch: u32, proof: &[u8]) -> Result<(), ChainError>
Source§async fn commit_block(&self, write: BlockWrite<'_>) -> Result<(), ChainError>
async fn commit_block(&self, write: BlockWrite<'_>) -> Result<(), ChainError>
ブロック1つ分を書いてコミットする。孤立ブロックの表にあれば外す
async fn prune(&self, prune: Prune) -> Result<Pruned, ChainError>
Source§async fn checkpoint_at_or_below(
&self,
height: u64,
) -> Result<Option<(u64, Vec<u8>)>, ChainError>
async fn checkpoint_at_or_below( &self, height: u64, ) -> Result<Option<(u64, Vec<u8>)>, ChainError>
height 以下で一番新しいチェックポイント(高さ、実行の状態)Source§async fn changes_above(&self, height: u64) -> Result<Vec<Change>, ChainError>
async fn changes_above(&self, height: u64) -> Result<Vec<Change>, ChainError>
height より上で変わった状態の行の、height のときの値Source§impl Default for MemoryStore
impl Default for MemoryStore
Source§fn default() -> MemoryStore
fn default() -> MemoryStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MemoryStore
impl !RefUnwindSafe for MemoryStore
impl !Sync for MemoryStore
impl Send for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
impl UnwindSafe for MemoryStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more