Struct snarkvm_compiler::BlockMemory
source · [−]pub struct BlockMemory<N: Network> { /* private fields */ }
Expand description
An in-memory block storage.
Trait Implementations
sourceimpl<N: Network> BlockStorage<N> for BlockMemory<N>
impl<N: Network> BlockStorage<N> for BlockMemory<N>
sourcefn reverse_id_map(&self) -> &Self::ReverseIDMap
fn reverse_id_map(&self) -> &Self::ReverseIDMap
Returns the reverse ID map.
sourcefn header_map(&self) -> &Self::HeaderMap
fn header_map(&self) -> &Self::HeaderMap
Returns the header map.
sourcefn transactions_map(&self) -> &Self::TransactionsMap
fn transactions_map(&self) -> &Self::TransactionsMap
Returns the transactions map.
sourcefn reverse_transactions_map(&self) -> &Self::ReverseTransactionsMap
fn reverse_transactions_map(&self) -> &Self::ReverseTransactionsMap
Returns the reverse transactions map.
sourcefn transaction_store(&self) -> &TransactionStore<N, Self::TransactionStorage>
fn transaction_store(&self) -> &TransactionStore<N, Self::TransactionStorage>
Returns the transaction store.
sourcefn signature_map(&self) -> &Self::SignatureMap
fn signature_map(&self) -> &Self::SignatureMap
Returns the signature map.
type ReverseIDMap = MemoryMap<<N as Network>::BlockHash, u32>
type ReverseIDMap = MemoryMap<<N as Network>::BlockHash, u32>
The mapping of block hash
to block height
.
type HeaderMap = MemoryMap<<N as Network>::BlockHash, Header<N>>
type HeaderMap = MemoryMap<<N as Network>::BlockHash, Header<N>>
The mapping of block hash
to block header
.
type TransactionsMap = MemoryMap<<N as Network>::BlockHash, Vec<<N as Network>::TransactionID, Global>>
type TransactionsMap = MemoryMap<<N as Network>::BlockHash, Vec<<N as Network>::TransactionID, Global>>
The mapping of block hash
to [transaction ID]
.
type ReverseTransactionsMap = MemoryMap<<N as Network>::TransactionID, <N as Network>::BlockHash>
type ReverseTransactionsMap = MemoryMap<<N as Network>::TransactionID, <N as Network>::BlockHash>
The mapping of transaction ID
to block hash
.
type TransactionStorage = TransactionMemory<N>
type TransactionStorage = TransactionMemory<N>
The transaction storage.
type TransitionStorage = TransitionMemory<N>
type TransitionStorage = TransitionMemory<N>
The transition storage.
type SignatureMap = MemoryMap<<N as Network>::BlockHash, Signature<N>>
type SignatureMap = MemoryMap<<N as Network>::BlockHash, Signature<N>>
The mapping of block hash
to block signature
.
sourcefn start_atomic(&self)
fn start_atomic(&self)
Starts an atomic batch write operation.
sourcefn is_atomic_in_progress(&self) -> bool
fn is_atomic_in_progress(&self) -> bool
Checks if an atomic batch is in progress.
sourcefn abort_atomic(&self)
fn abort_atomic(&self)
Aborts an atomic batch write operation.
sourcefn finish_atomic(&self) -> Result<()>
fn finish_atomic(&self) -> Result<()>
Finishes an atomic batch write operation.
sourcefn remove(&self, block_hash: &N::BlockHash) -> Result<()>
fn remove(&self, block_hash: &N::BlockHash) -> Result<()>
Removes the block for the given block hash
.
sourcefn find_block_hash(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<N::BlockHash>>
fn find_block_hash(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<N::BlockHash>>
Returns the block hash that contains the given transaction ID
.
sourcefn get_previous_block_hash(&self, height: u32) -> Result<Option<N::BlockHash>>
fn get_previous_block_hash(&self, height: u32) -> Result<Option<N::BlockHash>>
Returns the previous block hash of the given block height
.
sourcefn get_block_hash(&self, height: u32) -> Result<Option<N::BlockHash>>
fn get_block_hash(&self, height: u32) -> Result<Option<N::BlockHash>>
Returns the block hash for the given block height
.
sourcefn get_block_height(&self, block_hash: &N::BlockHash) -> Result<Option<u32>>
fn get_block_height(&self, block_hash: &N::BlockHash) -> Result<Option<u32>>
Returns the block height for the given block hash
.
sourcefn get_block_header(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Header<N>>>
fn get_block_header(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Header<N>>>
Returns the block header for the given block hash
.
sourcefn get_block_transactions(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Transactions<N>>>
fn get_block_transactions(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Transactions<N>>>
Returns the block transactions for the given block hash
.
sourcefn get_block_signature(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Signature<N>>>
fn get_block_signature(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Signature<N>>>
Returns the block signature for the given block hash
.
sourceimpl<N: Clone + Network> Clone for BlockMemory<N> where
N::BlockHash: Clone,
N::BlockHash: Clone,
N::BlockHash: Clone,
N::BlockHash: Clone,
N::TransactionID: Clone,
N::TransactionID: Clone,
N::BlockHash: Clone,
N::BlockHash: Clone,
impl<N: Clone + Network> Clone for BlockMemory<N> where
N::BlockHash: Clone,
N::BlockHash: Clone,
N::BlockHash: Clone,
N::BlockHash: Clone,
N::TransactionID: Clone,
N::TransactionID: Clone,
N::BlockHash: Clone,
N::BlockHash: Clone,
sourcefn clone(&self) -> BlockMemory<N>
fn clone(&self) -> BlockMemory<N>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<N> !RefUnwindSafe for BlockMemory<N>
impl<N> Send for BlockMemory<N>
impl<N> Sync for BlockMemory<N>
impl<N> Unpin for BlockMemory<N> where
N: Unpin,
impl<N> !UnwindSafe for BlockMemory<N>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more