Skip to main content

resource

Attribute Macro resource 

Source
#[resource]
Expand description

Apply to impl Resource for ... blocks (or the Resource trait definition itself).

Rewrites every async fn method into a method returning Pin<Box<dyn Future<Output = ...> + Send + 'async_trait>>. Behaviorally identical to task and node; the separate name makes the attribute self-documenting at impl sites.