Expand description
§bevy_pipe_affect
Write systems as pure functions
Normally, Bevy systems perform some state changes as side effects.
This crate enables you to instead return Effects as system output.
Effects define an ECS state transition.
All common ECS operations have one or more Effect types provided in the library.
These “systems with effects” can then be .pipe(affect)-ed.
The affect system will perform the state transition.
This enables a more functional code-style in bevy app development.
User-written systems can all be read-only, pure functions.
All mutability can be piped out of your code.
§This API Reference
The purpose of this API reference is to describe the API provided by this library.
More explanation-oriented documentation, tutorials, and guides are available in the
bevy_pipe_affect book.
The following are good jumping-off points for beginners:
- Motivations explanation
- effects module api reference (a list of effects and constructors provided by the library)
Cargo examples are also available in this library’s github repository.
§Feature flags
This crate provides the following set of feature flags:
derive: enables theEffectderive macro for structs and enums of effectsasset: enables thebevy/bevy_assetfeature andAsset-related effects
None of these are enabled by default.
Modules§
- effect_
composition Effectcomposition functions, that can be used within_and_then_composeandEffectOut::and_then_compose.- effects
Effectimplementors and their constructors.- prelude
use bevy_pipe_affect::prelude::*;to import common items.- query_
data_ effects - Contains implementations of
QueryDataEffect - system_
combinators bevysystems and higher-order system constructors related to effects piping and composition.
Structs§
Traits§
- Effect
- Define a state transition in
bevy’s ECS. - Query
Data Effect - Define a state transition for the
QueryDataof individual entities.
Functions§
- effect_
out - Construct a new
EffectOut.