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§impl Display for UncleBlock
impl Display for UncleBlock
Source§impl Entity for UncleBlock
impl Entity for UncleBlock
const NAME: &'static str = "UncleBlock"
type Builder = UncleBlockBuilder
fn new_unchecked(data: Bytes) -> Self
fn as_bytes(&self) -> Bytes
fn as_slice(&self) -> &[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
Source§impl Hash for UncleBlock
impl Hash for UncleBlock
Source§impl LowerHex for UncleBlock
impl LowerHex for UncleBlock
Source§impl PartialEq for UncleBlock
impl PartialEq for UncleBlock
impl Eq for UncleBlock
Auto Trait Implementations§
impl !Freeze for UncleBlock
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.