pub struct CallArgs(/* private fields */);Expand description
Represents a collection of arguments passed to a smart contract entrypoint call.
Wraps casper’s RuntimeArgs.
Implementations§
Source§impl CallArgs
impl CallArgs
Sourcepub fn as_casper_runtime_args(&self) -> &RuntimeArgs
pub fn as_casper_runtime_args(&self) -> &RuntimeArgs
Return Casper’s RuntimeArgs.
Methods from Deref<Target = RuntimeArgs>§
Sourcepub fn insert<K, V>(&mut self, key: K, value: V) -> Result<(), CLValueError>
pub fn insert<K, V>(&mut self, key: K, value: V) -> Result<(), CLValueError>
Inserts a new named argument into the collection.
Sourcepub fn insert_cl_value<K>(&mut self, key: K, cl_value: CLValue)
pub fn insert_cl_value<K>(&mut self, key: K, cl_value: CLValue)
Inserts a new named argument into the collection.
Sourcepub fn named_args(&self) -> impl Iterator<Item = &NamedArg>
pub fn named_args(&self) -> impl Iterator<Item = &NamedArg>
Returns an iterator of references over all arguments in insertion order.
Sourcepub fn named_args_mut(&mut self) -> impl Iterator<Item = &mut NamedArg>
pub fn named_args_mut(&mut self) -> impl Iterator<Item = &mut NamedArg>
Returns an iterator of mutable references over all arguments in insertion order.
Sourcepub fn try_get_number(&self, name: &str) -> Result<U512, CLValueError>
pub fn try_get_number(&self, name: &str) -> Result<U512, CLValueError>
Returns the numeric value of name arg from the runtime arguments or defaults to
0 if that arg doesn’t exist or is not an integer type.
Supported CLTypes for numeric conversions are U64, and U512.
Returns an error if parsing the arg fails.
Trait Implementations§
Source§impl ToBytes for CallArgs
impl ToBytes for CallArgs
Source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Returns the length of the
Vec<u8> which would be returned from a successful call to
to_bytes() or into_bytes(). The data is not actually serialized, so this call is
relatively cheap.Auto Trait Implementations§
impl Freeze for CallArgs
impl RefUnwindSafe for CallArgs
impl Send for CallArgs
impl Sync for CallArgs
impl Unpin for CallArgs
impl UnsafeUnpin for CallArgs
impl UnwindSafe for CallArgs
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