From e19923b4b551cdd3490e91f47d45738b088ddad8 Mon Sep 17 00:00:00 2001 From: TGRCDev Date: Fri, 31 Jan 2025 19:39:15 -0800 Subject: [PATCH] `pipe_in` documentation --- bevy-butler/src/lib.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/bevy-butler/src/lib.rs b/bevy-butler/src/lib.rs index bd97ed1..e5a8510 100644 --- a/bevy-butler/src/lib.rs +++ b/bevy-butler/src/lib.rs @@ -118,6 +118,32 @@ pub use bevy_butler_proc_macro::butler_plugin; /// info!("Resource: {}", res.0); /// } /// ``` +/// +/// ## `pipe_in` +/// One or more system pipes to use as inputs to the system. +/// +/// Pipes are used in the order given, so `pipe_in(sys1, sys2)` would result in `sys1.pipe(sys2).pipe()`. +/// +/// For more info, see the [Bevy Cheat Book](https://bevy-cheatbook.github.io/programming/system-piping.html) page on system piping. +/// +/// ```rust +/// # use bevy_butler::*; +/// # use bevy::prelude::*; +/// # #[butler_plugin] +/// # struct MyPlugin; +/// fn get_name() -> String { +/// "World".to_string() +/// } +/// +/// fn greet_name(name: In) -> String { +/// format!("Hello, {}!", *name) +/// } +/// +/// #[system(plugin = MyPlugin, schedule = Startup, pipe_in(get_name, greet_name))] +/// fn print_greeting(greeting: In) { +/// info!("{}", *greeting); +/// } +/// ``` /// /// ## System transforms /// Any attribute that doesn't match the above is assumed to be a system transform function, like [`run_if`](bevy_ecs::prelude::IntoSystemConfigs::run_if)