ContractRef

Trait ContractRef 

Source
pub trait ContractRef {
    // Required methods
    fn new(env: Rc<ContractEnv>, address: Address) -> Self;
    fn address(&self) -> &Address;
    fn with_tokens(&self, tokens: U512) -> Self;
}
Expand description

Trait that needs to be implemented by all contract refs.

Required Methods§

Source

fn new(env: Rc<ContractEnv>, address: Address) -> Self

Creates a new instance of the Contract Ref.

Source

fn address(&self) -> &Address

Returns the address of the contract.

Source

fn with_tokens(&self, tokens: U512) -> Self

Creates a new contract reference with attached tokens, based on the current instance.

If there are tokens attached to the current instance, the tokens will be attached to the next contract call.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§