Struct casper_types::runtime_args::RuntimeArgs[][src]

pub struct RuntimeArgs(_);

Represents a collection of arguments passed to a smart contract.

Implementations

impl RuntimeArgs[src]

pub fn new() -> RuntimeArgs[src]

Create an empty RuntimeArgs instance.

pub fn try_new<F>(func: F) -> Result<RuntimeArgs, CLValueError> where
    F: FnOnce(&mut RuntimeArgs) -> Result<(), CLValueError>, 
[src]

A wrapper that lets you easily and safely create runtime arguments.

This method is useful when you have to construct a RuntimeArgs with multiple entries, but error handling at given call site would require to have a match statement for each RuntimeArgs::insert call. With this method you can use ? operator inside the closure and then handle single result. When try_block will be stabilized this method could be deprecated in favor of using those blocks.

pub fn get(&self, name: &str) -> Option<&CLValue>[src]

Gets an argument by its name.

pub fn len(&self) -> usize[src]

Get length of the collection.

pub fn is_empty(&self) -> bool[src]

Check if collection of arguments is empty.

pub fn insert<K, V>(&mut self, key: K, value: V) -> Result<(), CLValueError> where
    K: Into<String>,
    V: CLTyped + ToBytes
[src]

Insert new named argument into the collection.

pub fn insert_cl_value<K>(&mut self, key: K, cl_value: CLValue) where
    K: Into<String>, 
[src]

Insert new named argument into the collection.

pub fn to_values(&self) -> Vec<&CLValue>[src]

Returns values held regardless of the variant.

Trait Implementations

impl Clone for RuntimeArgs[src]

impl DataSize for RuntimeArgs[src]

impl Debug for RuntimeArgs[src]

impl Default for RuntimeArgs[src]

impl<'de> Deserialize<'de> for RuntimeArgs[src]

impl Eq for RuntimeArgs[src]

impl From<BTreeMap<String, CLValue>> for RuntimeArgs[src]

impl From<Vec<NamedArg, Global>> for RuntimeArgs[src]

impl FromBytes for RuntimeArgs[src]

impl Hash for RuntimeArgs[src]

impl Into<BTreeMap<String, CLValue>> for RuntimeArgs[src]

impl Ord for RuntimeArgs[src]

impl PartialEq<RuntimeArgs> for RuntimeArgs[src]

impl PartialOrd<RuntimeArgs> for RuntimeArgs[src]

impl Serialize for RuntimeArgs[src]

impl StructuralEq for RuntimeArgs[src]

impl StructuralPartialEq for RuntimeArgs[src]

impl ToBytes for RuntimeArgs[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,