pub struct Block(_);
Implementations
sourceimpl 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>
sourceimpl Block
impl Block
sourcepub fn new_advanced_builder() -> BlockBuilder
pub fn new_advanced_builder() -> BlockBuilder
Creates an empty advanced builder.
sourcepub fn as_advanced_builder(&self) -> BlockBuilder
pub fn as_advanced_builder(&self) -> BlockBuilder
Creates an advanced builder base on current data.
sourceimpl Block
impl Block
sourcepub fn into_view_without_reset_header(self) -> BlockView
pub fn into_view_without_reset_header(self) -> BlockView
sourceimpl 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()
.
sourceimpl Block
impl Block
sourcepub fn calc_proposals_hash(&self) -> Byte32
pub fn calc_proposals_hash(&self) -> Byte32
sourceimpl 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()
.
sourceimpl Block
impl Block
sourcepub fn calc_extra_hash(&self) -> ExtraHashView
pub fn calc_extra_hash(&self) -> ExtraHashView
Calls BlockReader.calc_extra_hash()
for self.as_reader()
.
sourceimpl 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()
.
sourceimpl Block
impl Block
sourcepub fn serialized_size_without_uncle_proposals(&self) -> usize
pub fn serialized_size_without_uncle_proposals(&self) -> usize
sourceimpl Block
impl Block
sourcepub fn as_uncle(&self) -> UncleBlock
pub fn as_uncle(&self) -> UncleBlock
Converts self to an uncle block.
sourcepub fn reset_header(self) -> Block
pub fn reset_header(self) -> Block
Recalculates all hashes and merkle roots in the header.
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 Entity for Block
impl Entity for Block
type Builder = BlockBuilder
const NAME: &'static str = "Block"
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
impl Eq for Block
Auto Trait Implementations
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
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