Struct pchain_sdk::CallDataBuilder
source · [−]Expand description
Builder to contruct CallData::arguments so that it can be passed to entrypoint
Basic example
let args_builder = smart_contract::CallDataBuilder::new();
args_builder
.add("i am string".to_string())
.add(0_i32)
.add(vec![0u8; 8]);
// construct Vec<u8> data to pass to CallData::arguments
let args :Vec<u8> = args_builder.to_call_arguments();
...Fields
args: Vec<Vec<u8>>Implementations
sourceimpl CallDataBuilder
impl CallDataBuilder
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 RefUnwindSafe for CallDataBuilder
impl Send for CallDataBuilder
impl Sync for CallDataBuilder
impl Unpin for CallDataBuilder
impl UnwindSafe for CallDataBuilder
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