Function bevy_ecs::system::adapter::new

source ·
pub fn new<T, U>(f: impl FnMut(T) -> U) -> impl FnMut(In<T>) -> U
👎Deprecated: use .map(...) instead
Expand description

Converts a regular function into a system adapter.

Examples

use bevy_ecs::prelude::*;

fn return1() -> u64 { 1 }

return1
    .pipe(system_adapter::new(u32::try_from))
    .pipe(system_adapter::unwrap)
    .pipe(print);

fn print(In(x): In<impl std::fmt::Debug>) {
    println!("{x:?}");
}