Skip to main content

service

Attribute Macro service 

Source
#[service]
Expand description

This attribute macro should be applied to traits that need to be turned into RPCs. The macro consumes the trait and outputs four items in its place. For a trait Calculator those are the structs CalculatorClient and CalculatorService, a new trait by the same name, and a CALCULATOR_DESCRIPTION const describing the trait for web_rpc::js::endpoint!. All methods must include &self as their first parameter.