[][src]Struct ckb_types::core::BlockBuilder

pub struct BlockBuilder { /* fields omitted */ }

An advanced builder for BlockView.

Base on packed::BlockBuilder but added lots of syntactic sugar.

Implementations

impl BlockBuilder[src]

pub fn version(self, v: Uint32) -> Self[src]

Sets header.version.

pub fn parent_hash(self, v: Byte32) -> Self[src]

Sets header.parent_hash.

pub fn timestamp(self, v: Uint64) -> Self[src]

Sets header.timestamp.

pub fn number(self, v: Uint64) -> Self[src]

Sets header.number.

pub fn transactions_root(self, v: Byte32) -> Self[src]

Sets header.transactions_root.

pub fn proposals_hash(self, v: Byte32) -> Self[src]

Sets header.proposals_hash.

pub fn compact_target(self, v: Uint32) -> Self[src]

Sets header.compact_target.

pub fn uncles_hash(self, v: Byte32) -> Self[src]

Sets header.uncles_hash.

pub fn epoch(self, v: Uint64) -> Self[src]

Sets header.epoch.

pub fn dao(self, v: Byte32) -> Self[src]

Sets header.dao.

pub fn nonce(self, v: Uint128) -> Self[src]

Sets header.nonce.

pub fn uncle(self, v: UncleBlockView) -> Self[src]

Pushes an item into uncles.

pub fn uncles<T>(self, v: T) -> Self where
    T: IntoIterator<Item = UncleBlockView>, 
[src]

Extends uncles with the contents of an iterator.

pub fn set_uncles(self, v: Vec<UncleBlockView>) -> Self[src]

Sets uncles.

pub fn transaction(self, v: TransactionView) -> Self[src]

Pushes an item into transactions.

pub fn transactions<T>(self, v: T) -> Self where
    T: IntoIterator<Item = TransactionView>, 
[src]

Extends transactions with the contents of an iterator.

pub fn set_transactions(self, v: Vec<TransactionView>) -> Self[src]

Sets transactions.

pub fn proposal(self, v: ProposalShortId) -> Self[src]

Pushes an item into proposals.

pub fn proposals<T>(self, v: T) -> Self where
    T: IntoIterator<Item = ProposalShortId>, 
[src]

Extends proposals with the contents of an iterator.

pub fn set_proposals(self, v: Vec<ProposalShortId>) -> Self[src]

Sets proposals.

pub fn header(self, header: HeaderView) -> Self[src]

Set header.

pub fn build(self) -> BlockView[src]

Converts into BlockView and recalculates all hashes and merkle roots in the header.

pub fn build_unchecked(self) -> BlockView[src]

Converts into BlockView but does not refresh all hashes and all merkle roots in the header.

Notice

BlockView created by this method could have invalid hashes or invalid merkle roots in the header.

Trait Implementations

impl Clone for BlockBuilder[src]

impl Debug for BlockBuilder[src]

impl Default for BlockBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,