Trait exocore_chain::block::Block [−][src]
A trait representing a block stored or to be stored in the chain.
It can either be a referenced block (BlockRef
) or a in-memory block
(BlockOwned
).
A block consists of 3 parts:
- Block header
- Operations’ bytes (capnp serialized
chain_operation
frames) - Block signatures
The block header and operations’ data are the same on all nodes. Since a node writes a block as soon as it has enough signatures, signatures can differ from one node to the other. Signatures frame is pre-allocated, which means that not all signatures may fit. But in theory, it should always contain enough space for all nodes to add their own signature.
Associated Types
type UnderlyingFrame: FrameReader<OwnedType = Bytes>
[src]
Required methods
fn offset(&self) -> BlockOffset
[src]
fn header(&self) -> &BlockHeaderFrame<Self::UnderlyingFrame>
[src]
fn operations_data(&self) -> &[u8]
[src]
fn signatures(&self) -> &SignaturesFrame<Self::UnderlyingFrame>
[src]
Provided methods
fn total_size(&self) -> usize
[src]
fn next_offset(&self) -> BlockOffset
[src]
fn copy_data_into(&self, data: &mut [u8])
[src]
fn as_data_vec(&self) -> Bytes
[src]
fn to_owned(&self) -> DataBlock<Bytes>
[src]
fn get_height(&self) -> Result<BlockHeight, Error>
[src]
fn get_proposed_operation_id(&self) -> Result<OperationId, Error>
[src]
fn operations_iter(&self) -> Result<BlockOperationsIterator<'_>, Error>
[src]
fn get_operation(
&self,
operation_id: OperationId
) -> Result<Option<OperationFrame<&[u8]>>, Error>
[src]
&self,
operation_id: OperationId
) -> Result<Option<OperationFrame<&[u8]>>, Error>