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§
Sourcefn new(env: Rc<ContractEnv>, address: Address) -> Self
fn new(env: Rc<ContractEnv>, address: Address) -> Self
Creates a new instance of the Contract Ref.
Sourcefn with_tokens(&self, tokens: U512) -> Self
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.