Struct ckb_types::core::BlockBuilder
source · [−]pub struct BlockBuilder { /* private fields */ }
Expand description
An advanced builder for BlockView
.
Base on packed::BlockBuilder
but added lots of syntactic sugar.
Implementations
sourceimpl BlockBuilder
impl BlockBuilder
sourcepub fn parent_hash(self, v: Byte32) -> Self
pub fn parent_hash(self, v: Byte32) -> Self
Sets header.parent_hash
.
sourcepub fn transactions_root(self, v: Byte32) -> Self
pub fn transactions_root(self, v: Byte32) -> Self
Sets header.transactions_root
.
sourcepub fn proposals_hash(self, v: Byte32) -> Self
pub fn proposals_hash(self, v: Byte32) -> Self
Sets header.proposals_hash
.
sourcepub fn compact_target(self, v: Uint32) -> Self
pub fn compact_target(self, v: Uint32) -> Self
Sets header.compact_target
.
sourcepub fn extra_hash(self, v: Byte32) -> Self
pub fn extra_hash(self, v: Byte32) -> Self
Sets header.extra_hash
.
sourcepub fn uncle(self, v: UncleBlockView) -> Self
pub fn uncle(self, v: UncleBlockView) -> Self
Pushes an item into uncles
.
sourcepub fn uncles<T>(self, v: T) -> Self where
T: IntoIterator<Item = UncleBlockView>,
pub fn uncles<T>(self, v: T) -> Self where
T: IntoIterator<Item = UncleBlockView>,
Extends uncles
with the contents of an iterator.
sourcepub fn set_uncles(self, v: Vec<UncleBlockView>) -> Self
pub fn set_uncles(self, v: Vec<UncleBlockView>) -> Self
Sets uncles
.
sourcepub fn transaction(self, v: TransactionView) -> Self
pub fn transaction(self, v: TransactionView) -> Self
Pushes an item into transactions
.
sourcepub fn transactions<T>(self, v: T) -> Self where
T: IntoIterator<Item = TransactionView>,
pub fn transactions<T>(self, v: T) -> Self where
T: IntoIterator<Item = TransactionView>,
Extends transactions
with the contents of an iterator.
sourcepub fn set_transactions(self, v: Vec<TransactionView>) -> Self
pub fn set_transactions(self, v: Vec<TransactionView>) -> Self
Sets transactions
.
sourcepub fn proposal(self, v: ProposalShortId) -> Self
pub fn proposal(self, v: ProposalShortId) -> Self
Pushes an item into proposals
.
sourcepub fn proposals<T>(self, v: T) -> Self where
T: IntoIterator<Item = ProposalShortId>,
pub fn proposals<T>(self, v: T) -> Self where
T: IntoIterator<Item = ProposalShortId>,
Extends proposals
with the contents of an iterator.
sourcepub fn set_proposals(self, v: Vec<ProposalShortId>) -> Self
pub fn set_proposals(self, v: Vec<ProposalShortId>) -> Self
Sets proposals
.
sourcepub fn header(self, header: HeaderView) -> Self
pub fn header(self, header: HeaderView) -> Self
Set header
.
Trait Implementations
sourceimpl Clone for BlockBuilder
impl Clone for BlockBuilder
sourcefn clone(&self) -> BlockBuilder
fn clone(&self) -> BlockBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BlockBuilder
impl Debug for BlockBuilder
sourceimpl Default for BlockBuilder
impl Default for BlockBuilder
sourcefn default() -> BlockBuilder
fn default() -> BlockBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for BlockBuilder
impl Send for BlockBuilder
impl Sync for BlockBuilder
impl Unpin for BlockBuilder
impl UnwindSafe for BlockBuilder
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