pub struct InputEntryFunctionDataBuilder { /* private fields */ }Expand description
Builder for InputEntryFunctionData.
Implementations§
Source§impl InputEntryFunctionDataBuilder
impl InputEntryFunctionDataBuilder
Sourcepub fn type_arg_typed(self, type_arg: TypeTag) -> Self
pub fn type_arg_typed(self, type_arg: TypeTag) -> Self
Adds a type argument from a TypeTag.
Sourcepub fn type_args(
self,
type_args: impl IntoIterator<Item = &'static str>,
) -> Self
pub fn type_args( self, type_args: impl IntoIterator<Item = &'static str>, ) -> Self
Adds multiple type arguments.
Sourcepub fn type_args_typed(
self,
type_args: impl IntoIterator<Item = TypeTag>,
) -> Self
pub fn type_args_typed( self, type_args: impl IntoIterator<Item = TypeTag>, ) -> Self
Adds multiple typed type arguments.
Sourcepub fn arg<T: Serialize>(self, value: T) -> Self
pub fn arg<T: Serialize>(self, value: T) -> Self
Adds a BCS-encodable argument.
Accepts any type that implements Serialize (BCS encoding).
§Supported Types
- Integers:
u8,u16,u32,u64,u128 - Boolean:
bool - Strings:
String,&str - Addresses:
AccountAddress - Vectors:
Vec<T>where T is serializable - Bytes:
Vec<u8>,&[u8]
§Example
ⓘ
let builder = InputEntryFunctionData::new("0x1::my_module::my_function")
.arg(42u64)
.arg(true)
.arg(AccountAddress::ONE)
.arg("hello".to_string());Sourcepub fn arg_raw(self, bytes: Vec<u8>) -> Self
pub fn arg_raw(self, bytes: Vec<u8>) -> Self
Adds a raw BCS-encoded argument.
Use this when you have pre-encoded bytes.
Sourcepub fn args<T: Serialize>(self, values: impl IntoIterator<Item = T>) -> Self
pub fn args<T: Serialize>(self, values: impl IntoIterator<Item = T>) -> Self
Adds multiple BCS-encodable arguments.
Sourcepub fn build(self) -> AptosResult<TransactionPayload>
pub fn build(self) -> AptosResult<TransactionPayload>
Sourcepub fn build_entry_function(self) -> AptosResult<EntryFunction>
pub fn build_entry_function(self) -> AptosResult<EntryFunction>
Builds just the entry function (without wrapping in TransactionPayload).
§Errors
Returns an error if the function ID is invalid, any type argument is invalid, or if any argument serialization failed.
Trait Implementations§
Source§impl Clone for InputEntryFunctionDataBuilder
impl Clone for InputEntryFunctionDataBuilder
Source§fn clone(&self) -> InputEntryFunctionDataBuilder
fn clone(&self) -> InputEntryFunctionDataBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InputEntryFunctionDataBuilder
impl RefUnwindSafe for InputEntryFunctionDataBuilder
impl Send for InputEntryFunctionDataBuilder
impl Sync for InputEntryFunctionDataBuilder
impl Unpin for InputEntryFunctionDataBuilder
impl UnwindSafe for InputEntryFunctionDataBuilder
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