//! [`Message`] functionality.
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use Message;
use crateMaybeLocation;
use Reflect;
use ;
/// A buffered message for pull-based event handling.
///
/// Messages can be written with [`MessageWriter`] and read using the [`MessageReader`] system parameter.
/// Messages are stored in the [`Messages<M>`] resource, and require periodically polling the world for new messages,
/// typically in a system that runs as part of a schedule.
///
/// While the polling imposes a small overhead, messages are useful for efficiently batch processing
/// a large number of messages at once. For cases like these, messages can be more efficient than [`Event`]s (which are handled via [`Observer`]s).
///
/// Unlike [`Event`]s triggered for observers, messages are evaluated at fixed points in the schedule
/// rather than immediately when they are sent. This allows for more predictable scheduling, and deferring
/// message processing to a later point in time.
///
/// Messages must be thread-safe.
///
/// # Usage
///
/// The [`Message`] trait can be derived:
///
/// ```
/// # use bevy_ecs::prelude::*;
/// #
/// #[derive(Message)]
/// struct Greeting(String);
/// ```
///
/// The message can then be written to the message buffer using a [`MessageWriter`]:
///
/// ```
/// # use bevy_ecs::prelude::*;
/// #
/// # #[derive(Message)]
/// # struct Greeting(String);
/// #
/// fn write_hello(mut writer: MessageWriter<Greeting>) {
/// writer.write(Greeting("Hello!".to_string()));
/// }
/// ```
///
/// Messages can be efficiently read using a [`MessageReader`]:
///
/// ```
/// # use bevy_ecs::prelude::*;
/// #
/// # #[derive(Message)]
/// # struct Greeting(String);
/// #
/// fn read_messages(mut reader: MessageReader<Greeting>) {
/// // Process all messages of type `Greeting`.
/// for Greeting(greeting) in reader.read() {
/// println!("{greeting}");
/// }
/// }
/// ```
/// [`Event`]: crate::event::Event
/// [`Observer`]: crate::observer::Observer
pub
/// A [`MessageId`] uniquely identifies a message stored in a specific [`World`].
///
/// A [`MessageId`] can, among other things, be used to trace the flow of a [`Message`] from the point it was
/// sent to the point it was processed. [`MessageId`]s increase monotonically by write order.
///
/// [`World`]: crate::world::World
Homonyms
cyb/evy/forks/naga/src/back/hlsl/mod.rs
struct Baz { m: mat3x2, } struct Baz { float2 m_0; float2 m_1; float2 m_2; }; float3x2 GetMatmOnBaz(Baz obj) { return float3x2(obj.m_0, obj.m_1, obj.m_2); }