rx_core_operator_identity

Crates.iorx_core_operator_identity
lib.rsrx_core_operator_identity
version0.2.0
created_at2026-01-19 15:43:01.123489+00
updated_at2026-01-24 15:07:32.855569+00
descriptionidentity operator for rx_core; a no-op operator mainly used to define input types for composite operators
homepagehttps://github.com/AlexAegis/rx_bevy
repositoryhttps://github.com/AlexAegis/rx_bevy
max_upload_size
id2054829
size11,403
Sandor (AlexAegis)

documentation

https://github.com/AlexAegis/rx_bevy

README

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
Commit count: 652

cargo fmt