34 releases (5 breaking)

new 0.6.2-alpha.1 May 2, 2025
0.6.1-alpha.1 Mar 28, 2025
0.5.8-alpha.1 May 1, 2025

#2514 in Procedural macros

Download history 349/week @ 2025-01-10 222/week @ 2025-01-17 794/week @ 2025-01-24 668/week @ 2025-01-31 310/week @ 2025-02-07 90/week @ 2025-02-14 14/week @ 2025-02-21 31/week @ 2025-02-28 162/week @ 2025-03-14 117/week @ 2025-03-21 136/week @ 2025-03-28 5/week @ 2025-04-04 8/week @ 2025-04-11 10/week @ 2025-04-18 268/week @ 2025-04-25

302 downloads per month
Used in bevy-butler

MIT/Apache

33KB
801 lines

bevy-butler

A set of procedural macros for making Bevy plugins and systems more self-documenting.

Crates.io License Crates.io Version docs.rs Crates.io MSRV

Version Compatibility

bevy bevy-butler
0.15 0.5

Example

use bevy::prelude::*;
use bevy_butler::*;

#[butler_plugin]
pub struct MyPlugin;

#[derive(Resource)]
#[resource(plugin = MyPlugin, init = Hello("World".to_string()))]
pub struct Hello(pub String);

#[system(schedule = Update, plugin = MyPlugin)]
fn hello_plugin(name: Res<Hello>)
{
    info!("Hello, {}!", name.0);
}

#[system(schedule = Update, plugin = MyPlugin, after = hello_plugin)]
fn goodbye_plugin(name: Res<Hello>)
{
    info!("Goodbye, {}!", name.0);
}

fn main() {
    App::new()
        .add_plugins(MyPlugin)
        .run();
}

WebAssembly support

WebAssembly support is currently locked behind the wasm-experimental flag. See the relevant issue for more information.

Dependencies

~4.5MB
~95K SLoC