Struct ckb_types::packed::CompactBlock
source · [−]pub struct CompactBlock(_);
Implementations
sourceimpl CompactBlock
impl CompactBlock
pub const FIELD_COUNT: usize = 5usize
pub fn total_size(&self) -> usize
pub fn field_count(&self) -> usize
pub fn count_extra_fields(&self) -> usize
pub fn has_extra_fields(&self) -> bool
pub fn header(&self) -> Header
pub fn short_ids(&self) -> ProposalShortIdVec
pub fn prefilled_transactions(&self) -> IndexTransactionVec
pub fn uncles(&self) -> Byte32Vec
pub fn proposals(&self) -> ProposalShortIdVec
pub fn as_reader<'r>(&'r self) -> CompactBlockReader<'r>
sourceimpl CompactBlock
impl CompactBlock
sourcepub fn calc_header_hash(&self) -> Byte32
pub fn calc_header_hash(&self) -> Byte32
sourceimpl CompactBlock
impl CompactBlock
sourcepub fn build_from_block(
block: &BlockView,
prefilled_transactions_indexes: &HashSet<usize>
) -> Self
pub fn build_from_block(
block: &BlockView,
prefilled_transactions_indexes: &HashSet<usize>
) -> Self
Builds a CompactBlock
from block and prefilled transactions indexes.
sourcepub fn block_short_ids(&self) -> Vec<Option<ProposalShortId>>
pub fn block_short_ids(&self) -> Vec<Option<ProposalShortId>>
Takes proposal short ids for the transactions which are not prefilled.
sourcepub fn short_id_indexes(&self) -> Vec<usize>
pub fn short_id_indexes(&self) -> Vec<usize>
Collects the short id indexes.
sourcepub fn extra_field(&self, index: usize) -> Option<Bytes>
pub fn extra_field(&self, index: usize) -> Option<Bytes>
Gets the i-th extra field if it exists; i started from 0.
Trait Implementations
sourceimpl Clone for CompactBlock
impl Clone for CompactBlock
sourcefn clone(&self) -> CompactBlock
fn clone(&self) -> CompactBlock
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
sourceimpl Debug for CompactBlock
impl Debug for CompactBlock
sourceimpl Default for CompactBlock
impl Default for CompactBlock
sourceimpl Display for CompactBlock
impl Display for CompactBlock
sourceimpl Entity for CompactBlock
impl Entity for CompactBlock
type Builder = CompactBlockBuilder
const NAME: &'static str = "CompactBlock"
fn new_unchecked(data: Bytes) -> Self
fn as_bytes(&self) -> Bytes
fn as_slice(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn from_slice(slice: &[u8]) -> VerificationResult<Self>
fn from_compatible_slice(slice: &[u8]) -> VerificationResult<Self>
fn new_builder() -> Self::Builder
fn as_builder(self) -> Self::Builder
sourceimpl From<CompactBlock> for RelayMessageUnion
impl From<CompactBlock> for RelayMessageUnion
sourcefn from(item: CompactBlock) -> Self
fn from(item: CompactBlock) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for CompactBlock
impl Send for CompactBlock
impl Sync for CompactBlock
impl Unpin for CompactBlock
impl UnwindSafe for CompactBlock
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