pub struct ProduceBlockRequest<'a, K: KVStore> {
cur_view: ViewNumber,
parent_block: Option<CryptoHash>,
block_tree_view: AppBlockTreeView<'a, K>,
}
Expand description
Request for an App
to produce a new block extending a specific parent_block
.
Fields§
§cur_view: ViewNumber
§parent_block: Option<CryptoHash>
§block_tree_view: AppBlockTreeView<'a, K>
Implementations§
source§impl<'a, K: KVStore> ProduceBlockRequest<'a, K>
impl<'a, K: KVStore> ProduceBlockRequest<'a, K>
sourcepub(crate) fn new(
cur_view: ViewNumber,
parent_block: Option<CryptoHash>,
block_tree_view: AppBlockTreeView<'a, K>,
) -> Self
pub(crate) fn new( cur_view: ViewNumber, parent_block: Option<CryptoHash>, block_tree_view: AppBlockTreeView<'a, K>, ) -> Self
Create a new ProduceBlockRequest
.
sourcepub fn cur_view(&self) -> ViewNumber
pub fn cur_view(&self) -> ViewNumber
Get the current view of the replica.
sourcepub fn parent_block(&self) -> Option<CryptoHash>
pub fn parent_block(&self) -> Option<CryptoHash>
Get the parent block of the block that this produce_block
call should extend.
sourcepub fn block_tree(&self) -> &AppBlockTreeView<'a, K>
pub fn block_tree(&self) -> &AppBlockTreeView<'a, K>
Get a current view of the block tree that this produce_block
call can safely read from without
risking non-determinism.
Auto Trait Implementations§
impl<'a, K> Freeze for ProduceBlockRequest<'a, K>
impl<'a, K> RefUnwindSafe for ProduceBlockRequest<'a, K>where
K: RefUnwindSafe,
impl<'a, K> Send for ProduceBlockRequest<'a, K>where
K: Sync,
impl<'a, K> Sync for ProduceBlockRequest<'a, K>where
K: Sync,
impl<'a, K> Unpin for ProduceBlockRequest<'a, K>
impl<'a, K> UnwindSafe for ProduceBlockRequest<'a, K>where
K: RefUnwindSafe,
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