Struct ckb_types::packed::UncleBlock
source · pub struct UncleBlock(/* private fields */);
Implementations§
source§impl UncleBlock
impl UncleBlock
sourcepub fn calc_header_hash(&self) -> Byte32
pub fn calc_header_hash(&self) -> Byte32
source§impl UncleBlock
impl UncleBlock
sourcepub fn calc_proposals_hash(&self) -> Byte32
pub fn calc_proposals_hash(&self) -> Byte32
source§impl UncleBlock
impl UncleBlock
sourcepub fn serialized_size_in_block() -> usize
pub fn serialized_size_in_block() -> usize
Calculates the serialized size of a UncleBlock in Block. The block has 1 more uncle:
- the block will has 1 more offset (+NUM_SIZE) in UncleBlockVec
- UncleBlockVec has 1 more UncleBlock.
UncleBlock comes with 1
total
field, and 2 field offsets, (+NUM_SIZE * 3) UncleBlock contains Header (+208) and empty proposals (only one total_size, + NUM_SIZE because it is a fixVec) The total is +NUM_SIZE*5 + Header.size() = 228 see tests block_size_should_not_include_uncles_proposals.
source§impl UncleBlock
impl UncleBlock
pub const FIELD_COUNT: usize = 2usize
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 proposals(&self) -> ProposalShortIdVec
pub fn as_reader<'r>(&'r self) -> UncleBlockReader<'r>
Trait Implementations§
source§impl Clone for UncleBlock
impl Clone for UncleBlock
source§fn clone(&self) -> UncleBlock
fn clone(&self) -> UncleBlock
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for UncleBlock
impl Debug for UncleBlock
source§impl Default for UncleBlock
impl Default for UncleBlock
source§fn default() -> UncleBlock
fn default() -> UncleBlock
Returns the “default value” for a type. Read more
source§impl Display for UncleBlock
impl Display for UncleBlock
source§impl Entity for UncleBlock
impl Entity for UncleBlock
type Builder = UncleBlockBuilder
const NAME: &'static str = "UncleBlock"
fn new_unchecked(data: Bytes) -> UncleBlock
fn as_bytes(&self) -> Bytes
fn as_slice(&self) -> &[u8] ⓘ
fn from_slice(slice: &[u8]) -> Result<UncleBlock, VerificationError>
fn from_compatible_slice(slice: &[u8]) -> Result<UncleBlock, VerificationError>
fn new_builder() -> <UncleBlock as Entity>::Builder
fn as_builder(self) -> <UncleBlock as Entity>::Builder
source§impl Hash for UncleBlock
impl Hash for UncleBlock
source§impl IntoUncleBlockView for UncleBlock
impl IntoUncleBlockView for UncleBlock
source§fn into_view(self) -> UncleBlockView
fn into_view(self) -> UncleBlockView
Calculates the header hash and converts into UncleBlockView
with the hash.
source§impl LowerHex for UncleBlock
impl LowerHex for UncleBlock
source§impl PartialEq for UncleBlock
impl PartialEq for UncleBlock
source§fn eq(&self, other: &UncleBlock) -> bool
fn eq(&self, other: &UncleBlock) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for UncleBlock
Auto Trait Implementations§
impl RefUnwindSafe for UncleBlock
impl Send for UncleBlock
impl Sync for UncleBlock
impl Unpin for UncleBlock
impl UnwindSafe for UncleBlock
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
source§impl<T> PackVec<UncleBlockVec, UncleBlock> for Twhere
T: IntoIterator<Item = UncleBlock>,
impl<T> PackVec<UncleBlockVec, UncleBlock> for Twhere
T: IntoIterator<Item = UncleBlock>,
source§fn pack(self) -> UncleBlockVec
fn pack(self) -> UncleBlockVec
Packs a vector of binary data into one binary data.