pub struct Block(/* private fields */);
Implementations§
Source§impl Block
impl Block
Sourcepub fn calc_header_hash(&self) -> Byte32
pub fn calc_header_hash(&self) -> Byte32
Calls BlockReader.calc_header_hash()
for self.as_reader()
.
Source§impl Block
impl Block
Sourcepub fn calc_uncles_hash(&self) -> Byte32
pub fn calc_uncles_hash(&self) -> Byte32
Calls BlockReader.calc_uncles_hash()
for self.as_reader()
.
Source§impl Block
impl Block
Sourcepub fn calc_tx_hashes(&self) -> Vec<Byte32>
pub fn calc_tx_hashes(&self) -> Vec<Byte32>
Calls BlockReader.calc_tx_hashes()
for self.as_reader()
.
Source§impl Block
impl Block
Sourcepub fn as_uncle(&self) -> UncleBlock
pub fn as_uncle(&self) -> UncleBlock
Converts self to an uncle block.
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.
Source§impl Block
impl Block
pub const FIELD_COUNT: usize = 4usize
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 uncles(&self) -> UncleBlockVec
pub fn transactions(&self) -> TransactionVec
pub fn proposals(&self) -> ProposalShortIdVec
pub fn as_reader<'r>(&'r self) -> BlockReader<'r>
Trait Implementations§
Source§impl AsBlockBuilder for Block
impl AsBlockBuilder for Block
Source§fn new_advanced_builder() -> BlockBuilder
fn new_advanced_builder() -> BlockBuilder
Creates an empty advanced builder.
Source§fn as_advanced_builder(&self) -> BlockBuilder
fn as_advanced_builder(&self) -> BlockBuilder
Creates an advanced builder base on current data.
Source§impl CalcExtraHash for Block
impl CalcExtraHash for Block
Source§fn calc_extra_hash(&self) -> ExtraHashView
fn calc_extra_hash(&self) -> ExtraHashView
Calls BlockReader.calc_extra_hash()
for self.as_reader()
.
Source§impl Entity for Block
impl Entity for Block
const NAME: &'static str = "Block"
type Builder = BlockBuilder
fn new_unchecked(data: Bytes) -> Block
fn as_bytes(&self) -> Bytes
fn as_slice(&self) -> &[u8] ⓘ
fn from_slice(slice: &[u8]) -> Result<Block, VerificationError>
fn from_compatible_slice(slice: &[u8]) -> Result<Block, VerificationError>
fn new_builder() -> <Block as Entity>::Builder
fn as_builder(self) -> <Block as Entity>::Builder
Source§impl IntoBlockView for Block
impl IntoBlockView for Block
Source§impl ResetBlock for Block
impl ResetBlock for Block
Source§fn reset_header(self) -> Block
fn reset_header(self) -> Block
Recalculates all hashes and merkle roots in the header.
impl Eq for Block
Auto Trait Implementations§
impl !Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
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
)