All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
Welcome to rxRust v1.0! This release represents a complete reimplementation of the library, moving to a Context-Driven Architecture. This design solves the "Thread-Safety vs. Performance" dilemma by allowing the same operator logic to adapt automatically to single-threaded (Local) or multi-threaded (Shared) environments at compile time.
- Unified Context System: Introduced the
Contexttrait as the foundation of all streams.LocalContext: Optimized for single-threaded environments (WASM, UI Main Threads). UsesRc<RefCell<T>>internally for zero-locking overhead.SharedContext: Thread-safe implementation for concurrency. UsesArc<Mutex<T>>and requiresSend + Sync.
- Implicit Scheduling: Schedulers are now bound to the Context.
Localstreams automatically useLocalScheduler(current thread/microtasks).Sharedstreams automatically useSharedScheduler(thread pool/tokio).- Time-based operators (
delay,debounce,throttle) no longer require explicit scheduler arguments by default.
- Zero-Cost Abstractions: Heavy reliance on generic specialization (
CoreObservable) ensures that operator chains compile down to efficient, monomorphized code with no unnecessary runtime overhead.
- Async Interoperability:
from_future/into_future: Convert between Rust Futures and Observables.from_stream/into_stream: Seamlessly bridge RustStream(Tokio/Async-std) with Rx operators.
- Enhanced Operator Suite: A comprehensive set of operators including:
- Transformation:
switch_map,concat_map,flat_map,scan,reduce,buffer,window. - Filtering:
debounce,throttle,sample,distinct_until_changed. - Combination:
combine_latest,with_latest_from,zip,merge,concat. - Utility:
retry,tap,delay,observe_on,subscribe_on.
- Transformation:
- WASM Support: First-class support for WebAssembly via
Localcontext, enabling high-performance reactive web apps. - Subject Improvements:
SubjectandBehaviorSubjectnow support "Multicasting" and adapt their internal locking strategy based on the Context they are created in.
- Custom Schedulers: Inject custom schedulers (e.g., for Game Loops, GUI Event Queues, or Test Virtual Time) using the new Type Alias pattern (e.g.,
type GameRx = LocalCtx<T, GameScheduler>). - Environment-Agnostic Operators: A new guide and traits (
CoreObservable,ObservableType) for authoring custom operators that work across all contexts without code duplication.
We sincerely apologize for the long delay in reaching version 1.0 and for the significant breaking changes introduced in this release. The core trait structure has undergone a complete overhaul. This difficult decision was made to address the inherent complexity of Rust's generics and to finally establish a stable, unified API foundation. We realized that without these fundamental changes, the library could not evolve sustainably.
- API Unification: Explicit types like
LocalObservableandSharedObservablefrom previous beta versions are replaced by theLocal::of(...)andShared::of(...)factory patterns. - Scheduler Usage: Explicit scheduler arguments have been removed from standard operators in favor of context-bound defaults. Use
_withvariants (e.g.,delay_with) for manual control.