Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 1.93 KB

README.md

File metadata and controls

70 lines (46 loc) · 1.93 KB

bevy_command_non_send

This is a small utility library for manipulating non-Send resources using Commands in Bevy.

Installation

This library is not added on crates.io, so you will need to depend on the Git repository directly.

$ cargo add --git https://github.com/BD103/bevy_command_non_send bevy_command_non_send

Alternatively, you can add it directly to Cargo.toml:

[dependencies]
bevy_command_non_send = { version = "0.x", git = "https://github.com/BD103/bevy_command_non_send" }

Usage

Please see the docs for the API reference. You most likely want to imports the CommandsExt trait, which adds several methods on top of Commands:

use bevy::prelude::*;
use bevy_command_non_send::CommandsExt;

struct MyNonSend(*const u8);

fn create_my_non_send(mut commands: Commands) {
    // `insert_non_send_resource` is a method imported with `CommandsExt`.
    commands.insert_non_send_resource(|| {
        MyNonSend(std::ptr::null())
    });
}

App::new()
    .add_systems(Startup, create_my_non_send)
    .run();

Bevy Compatibility

Bevy bevy_command_non_send
0.13 0.1

License

bevy_command_non_send is dual-licensed under either

at your option.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.