#rx-core-operator #rx-bevy-operator #rx-core #rx #rx-bevy

rx_core_operator_identity

identity operator for rx_core; a no-op operator mainly used to define input types for composite operators

6 releases

Uses new Rust 2024

new 0.2.1 Feb 1, 2026
0.2.0 Jan 24, 2026
0.1.2 Jan 24, 2026
0.0.1 Jan 19, 2026

#47 in #rx-core-operator


Used in 2 crates (via rx_core)

MIT license

160KB
4.5K SLoC

operator_identity

crates.io ci codecov license

The identity operator is a no-op operator.

In layman's terms: speedy thing goes in, speedy thing comes out.

It is used to conveniently define the input types of a composite operator. This is why only this operator has a standalone compose_operator function and has no Observable extension methods.

See Also

Example

cargo run -p rx_core --example operator_identity_example
// If it would exist, this would be the same as: `just(1).identity().subscribe(...)`
let _s = IdentityOperator::default()
    .operate(just(1))
    .subscribe(PrintObserver::new("identity_operator"));
identity_operator - next: 1
identity_operator - completed
identity_operator - unsubscribed

Example (Composite)

cargo run -p rx_core --example operator_identity_composite_example
let composite_operator = compose_operator::<i32, Never>()
    .map(|i| i + 1)
    .filter(|i, _| i < &4);

let _s = (1..=5)
    .into_observable()
    .pipe(composite_operator)
    .subscribe(PrintObserver::new("identity_operator (composite)"));
identity_operator (composite) - next: 2
identity_operator (composite) - next: 3
identity_operator (composite) - completed
identity_operator (composite) - unsubscribed

Dependencies

~275–750KB
~18K SLoC