Struct snarkvm_compiler::BlockStore
source · [−]pub struct BlockStore<N: Network, B: BlockStorage<N>> { /* private fields */ }
Expand description
The block store.
Implementations
sourceimpl<N: Network, B: BlockStorage<N>> BlockStore<N, B>
impl<N: Network, B: BlockStorage<N>> BlockStore<N, B>
sourcepub fn remove(&self, block_hash: &N::BlockHash) -> Result<()>
pub fn remove(&self, block_hash: &N::BlockHash) -> Result<()>
Removes the block for the given block hash
.
sourcepub fn transaction_store(&self) -> &TransactionStore<N, B::TransactionStorage>
pub fn transaction_store(&self) -> &TransactionStore<N, B::TransactionStorage>
Returns the transaction store.
sourcepub fn transition_store(&self) -> &TransitionStore<N, B::TransitionStorage>
pub fn transition_store(&self) -> &TransitionStore<N, B::TransitionStorage>
Returns the transition store.
sourcepub fn start_atomic(&self)
pub fn start_atomic(&self)
Starts an atomic batch write operation.
sourcepub fn abort_atomic(&self)
pub fn abort_atomic(&self)
Aborts an atomic batch write operation.
sourcepub fn finish_atomic(&self) -> Result<()>
pub fn finish_atomic(&self) -> Result<()>
Finishes an atomic batch write operation.
sourceimpl<N: Network, B: BlockStorage<N>> BlockStore<N, B>
impl<N: Network, B: BlockStorage<N>> BlockStore<N, B>
sourcepub fn get_previous_block_hash(
&self,
height: u32
) -> Result<Option<N::BlockHash>>
pub fn get_previous_block_hash(
&self,
height: u32
) -> Result<Option<N::BlockHash>>
Returns the previous block hash of the given block height
.
sourcepub fn get_block_hash(&self, height: u32) -> Result<Option<N::BlockHash>>
pub fn get_block_hash(&self, height: u32) -> Result<Option<N::BlockHash>>
Returns the block hash for the given block height
.
sourcepub fn get_block_height(&self, block_hash: &N::BlockHash) -> Result<Option<u32>>
pub fn get_block_height(&self, block_hash: &N::BlockHash) -> Result<Option<u32>>
Returns the block height for the given block hash
.
sourcepub fn get_block_header(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Header<N>>>
pub fn get_block_header(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Header<N>>>
Returns the block header for the given block hash
.
sourcepub fn get_block_transactions(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Transactions<N>>>
pub fn get_block_transactions(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Transactions<N>>>
Returns the block transactions for the given block hash
.
sourcepub fn get_block_signature(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Signature<N>>>
pub fn get_block_signature(
&self,
block_hash: &N::BlockHash
) -> Result<Option<Signature<N>>>
Returns the block signature for the given block hash
.
sourceimpl<N: Network, B: BlockStorage<N>> BlockStore<N, B>
impl<N: Network, B: BlockStorage<N>> BlockStore<N, B>
sourcepub fn find_block_hash(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<N::BlockHash>>
pub fn find_block_hash(
&self,
transaction_id: &N::TransactionID
) -> Result<Option<N::BlockHash>>
Returns the block hash that contains the given transaction ID
.
sourceimpl<N: Network, B: BlockStorage<N>> BlockStore<N, B>
impl<N: Network, B: BlockStorage<N>> BlockStore<N, B>
sourcepub fn contains_block_height(&self, height: u32) -> Result<bool>
pub fn contains_block_height(&self, height: u32) -> Result<bool>
Returns true
if the given block height exists.
sourcepub fn contains_block_hash(&self, block_hash: &N::BlockHash) -> Result<bool>
pub fn contains_block_hash(&self, block_hash: &N::BlockHash) -> Result<bool>
Returns true
if the given block hash exists.
sourceimpl<N: Network, B: BlockStorage<N>> BlockStore<N, B>
impl<N: Network, B: BlockStorage<N>> BlockStore<N, B>
Trait Implementations
sourceimpl<N: Clone + Network, B: Clone + BlockStorage<N>> Clone for BlockStore<N, B>
impl<N: Clone + Network, B: Clone + BlockStorage<N>> Clone for BlockStore<N, B>
sourcefn clone(&self) -> BlockStore<N, B>
fn clone(&self) -> BlockStore<N, B>
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, B> RefUnwindSafe for BlockStore<N, B> where
B: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, B> Send for BlockStore<N, B> where
B: Send,
impl<N, B> Sync for BlockStore<N, B>
impl<N, B> Unpin for BlockStore<N, B> where
B: Unpin,
N: Unpin,
impl<N, B> UnwindSafe for BlockStore<N, B> where
B: UnwindSafe,
N: UnwindSafe,
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