pub struct ContractMethodInputBuilder {
pub args: Vec<Vec<u8>>,
}
Expand description
Builder to contruct arguments in Call command so that it can be passed to entrypoint
§Basic example
let args_builder = pchain_sdk::ContractMethodInputBuilder::new();
args_builder
.add("i am string".to_string())
.add(0_i32)
.add(vec![0u8; 8]);
// construct Vec<u8> data to pass to call arguments
let args :Vec<u8> = args_builder.to_call_arguments();
...
Fields§
§args: Vec<Vec<u8>>
Implementations§
Source§impl ContractMethodInputBuilder
impl ContractMethodInputBuilder
pub fn new() -> Self
pub fn add<T: BorshSerialize>(&mut self, arg: T) -> &mut Self
pub fn to_call_arguments(&self) -> Vec<u8> ⓘ
Auto Trait Implementations§
impl Freeze for ContractMethodInputBuilder
impl RefUnwindSafe for ContractMethodInputBuilder
impl Send for ContractMethodInputBuilder
impl Sync for ContractMethodInputBuilder
impl Unpin for ContractMethodInputBuilder
impl UnwindSafe for ContractMethodInputBuilder
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