#[contract]Expand description
Re-export the contract proc macro. The main contract proc macro.
Applied to a module containing a contract struct and impl block. Extracts metadata and generates schema + extern wrappers.
ยงErrors
This macro will produce compile errors if:
- The module has no content (just a declaration like
mod foo;) - The module contains glob imports (
use foo::*) - The module contains relative imports (
use self::,use super::,use crate::) - The module contains multiple
pub structdeclarations - The module contains no
pub struct - The module contains no impl block for the contract struct
- A public method has no
selfreceiver (associated functions) - A public method has generic type or const parameters
- A public method is async
- A public method consumes
selfinstead of borrowing it - A public method uses
impl Traitin parameters or return type