pub struct TransactionBuilder {
pub version: Uint32,
pub cell_deps: Vec<CellDep>,
pub header_deps: Vec<Byte32>,
pub inputs: Vec<CellInput>,
pub outputs: Vec<CellOutput>,
pub witnesses: Vec<Bytes>,
pub outputs_data: Vec<Bytes>,
}Expand description
An advanced builder for TransactionView.
Base on packed::TransactionBuilder but added lots of syntactic sugar.
Fields§
§version: Uint32§cell_deps: Vec<CellDep>§header_deps: Vec<Byte32>§inputs: Vec<CellInput>§outputs: Vec<CellOutput>§witnesses: Vec<Bytes>§outputs_data: Vec<Bytes>Implementations§
Source§impl TransactionBuilder
impl TransactionBuilder
pub fn get_cell_deps(&self) -> &Vec<CellDep>
pub fn get_header_deps(&self) -> &Vec<Byte32>
pub fn get_inputs(&self) -> &Vec<CellInput>
pub fn get_outputs(&self) -> &Vec<CellOutput>
pub fn get_witnesses(&self) -> &Vec<Bytes>
pub fn get_outputs_data(&self) -> &Vec<Bytes>
Source§impl TransactionBuilder
impl TransactionBuilder
Sourcepub fn cell_deps<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = CellDep>,
pub fn cell_deps<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = CellDep>,
Extends cell_deps with the contents of an iterator.
Sourcepub fn set_cell_deps(&mut self, v: Vec<CellDep>) -> &mut Self
pub fn set_cell_deps(&mut self, v: Vec<CellDep>) -> &mut Self
Sets cell_deps.
Sourcepub fn dedup_cell_dep(&mut self, v: CellDep) -> &mut Self
pub fn dedup_cell_dep(&mut self, v: CellDep) -> &mut Self
Pushes an item into cell_deps only if the same item is not already in.
Sourcepub fn dedup_cell_deps<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = CellDep>,
pub fn dedup_cell_deps<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = CellDep>,
Extends cell_deps with the contents of an iterator, skip already exist ones.
Sourcepub fn header_dep(&mut self, v: Byte32) -> &mut Self
pub fn header_dep(&mut self, v: Byte32) -> &mut Self
Pushes an item into header_deps.
Sourcepub fn header_deps<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = Byte32>,
pub fn header_deps<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = Byte32>,
Extends header_deps with the contents of an iterator.
Sourcepub fn set_header_deps(&mut self, v: Vec<Byte32>) -> &mut Self
pub fn set_header_deps(&mut self, v: Vec<Byte32>) -> &mut Self
Sets header_deps.
Sourcepub fn dedup_header_dep(&mut self, v: Byte32) -> &mut Self
pub fn dedup_header_dep(&mut self, v: Byte32) -> &mut Self
Pushes an item into header_deps only if the same item is not already in.
Sourcepub fn dedup_header_deps<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = Byte32>,
pub fn dedup_header_deps<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = Byte32>,
Extends header_deps with the contents of an iterator, skip already exist ones.
Sourcepub fn inputs<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = CellInput>,
pub fn inputs<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = CellInput>,
Extends inputs with the contents of an iterator.
Sourcepub fn set_inputs(&mut self, v: Vec<CellInput>) -> &mut Self
pub fn set_inputs(&mut self, v: Vec<CellInput>) -> &mut Self
Sets inputs.
Sourcepub fn output(&mut self, v: CellOutput) -> &mut Self
pub fn output(&mut self, v: CellOutput) -> &mut Self
Pushes an item into outputs.
Sourcepub fn outputs<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = CellOutput>,
pub fn outputs<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = CellOutput>,
Extends outputs with the contents of an iterator.
Sourcepub fn set_outputs(&mut self, v: Vec<CellOutput>) -> &mut Self
pub fn set_outputs(&mut self, v: Vec<CellOutput>) -> &mut Self
Sets outputs.
pub fn set_output(&mut self, i: usize, v: CellOutput) -> &mut Self
Sourcepub fn witnesses<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = Bytes>,
pub fn witnesses<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = Bytes>,
Extends witnesses with the contents of an iterator.
Sourcepub fn set_witnesses(&mut self, v: Vec<Bytes>) -> &mut Self
pub fn set_witnesses(&mut self, v: Vec<Bytes>) -> &mut Self
Sets witnesses.
pub fn set_witness(&mut self, i: usize, v: Bytes) -> &mut Self
Sourcepub fn output_data(&mut self, v: Bytes) -> &mut Self
pub fn output_data(&mut self, v: Bytes) -> &mut Self
Pushes an item into outputs_data.
Sourcepub fn outputs_data<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = Bytes>,
pub fn outputs_data<T>(&mut self, v: T) -> &mut Selfwhere
T: IntoIterator<Item = Bytes>,
Extends outputs_data with the contents of an iterator.
Sourcepub fn set_outputs_data(&mut self, v: Vec<Bytes>) -> &mut Self
pub fn set_outputs_data(&mut self, v: Vec<Bytes>) -> &mut Self
Sets outputs_data.
pub fn set_output_data(&mut self, i: usize, v: Bytes) -> &mut Self
Sourcepub fn build(self) -> TransactionView
pub fn build(self) -> TransactionView
Converts into TransactionView.
Trait Implementations§
Source§impl Clone for TransactionBuilder
impl Clone for TransactionBuilder
Source§fn clone(&self) -> TransactionBuilder
fn clone(&self) -> TransactionBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransactionBuilder
impl Debug for TransactionBuilder
Auto Trait Implementations§
impl !Freeze for TransactionBuilder
impl RefUnwindSafe for TransactionBuilder
impl Send for TransactionBuilder
impl Sync for TransactionBuilder
impl Unpin for TransactionBuilder
impl UnwindSafe for TransactionBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more