MessageWriter (message/message_writer.rs)

bevy · crates/bevy_ecs/src/message/message_writer.rs · rust · Apache-2.0
database

System parameter that writes typed messages into the ECS message bus.

// Source: https://github.com/bevyengine/bevy | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
use crate::{
    message::{Message, MessageId, Messages, WriteBatchIds},
    system::{ResMut, SystemAccess, SystemParam, SystemParamAccessConflict},
};

/// Writes [`Message`]s of type `T`.
///
/// This system parameter takes exclusive access to the [`Messages<T>`] resource,
/// so a system cannot also have a [`MessageReader`](super::MessageReader) parameter of the same type.
/// If you need to both read and write messages of the same type,
/// use [`MessageMutator`](super::MessageMutator).
///
/// # Usage
///
/// `MessageWriter`s are usually declared as a [`SystemParam`].
/// ```
/// # use bevy_ecs::prelude::*;
///
/// #[derive(Message)]
/// pub struct MyMes

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key