Skip to main content

Resource

Derive Macro Resource 

Source
#[derive(Resource)]
Expand description

Derive an empty cano::Resource impl (uses the trait’s default no-op setup / teardown).

Apply this derive to any struct that needs to implement Resource but has no custom lifecycle logic. The trait’s setup and teardown defaults (which return Ok(())) take effect automatically.

§Example

use cano::prelude::*;

#[derive(Resource)]
struct MyConfig {
    timeout_ms: u64,
}