Skip to main content

ContractState

Trait ContractState 

Source
pub trait ContractState: From<Keypath> { }
Expand description

Marker for types usable as a contract’s root state by #[contract].

Automatically implemented for every type that implements From<Keypath> — i.e. anything annotated with #[storage], including unit structs like struct Token;. Contract methods taking &self/&mut self require the state type to implement this trait; contracts with only associated functions never construct state and do not need it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§