0.8.3 (2020-03-26)
- operator:
sample
support clone, and not require source observer and sample observable return same subscription.
0.8.2 (2020-03-25)
operator: add some explicit bounds on operators method to improve type infer, and some code use map
may not compile, if it's just map
and never subscribe.
Subject: MutRefSubject now mark as unsafe.
- operator: remove unnecessary lifetime bounds on
box_it
operator.
- subscription The guard returned by
unsubscribe_when_dropped()
has the must_use attribute - operator: add
zip
operator. - operator: add
take_until
operator. - operator: add
take_while
operator. - operator: add
share
operator. - operator: add
default_if_empty
operator. - observer: add support for items/errors that don't implement
Copy
(by implementingPayloadCopy
) - observable: add macros
of_sequence
that producing values from a custom sequence. - subject: add
subscribed_size
method on Subject.
0.8.1 (2020-02-28)
- docs: fix docs link and remove inner macro from docs.
0.8.0 (2020-02-28)
- operator: add
box_it
operator to box observable. - operator: add
skip
operator. - operator: add
skip_last
operator. - operator: add
take_last
operator. - subscription The return value of
subscribe
,subscribe_err
,subscribe_complete
andsubscribe_all
now provides a methodunsubscribe_when_dropped()
which activates "RAII" behavior for this subscription. That meansunsubscribe()
will be called automatically as soon as the value returned byunsubscribe_when_dropped()
goes out of scope. If you don't assign the return value to a variable,unsubscribe()
is called immediately!
- observable: Operators as provided methods on Observable instead of extension traits.
- observable: Every observable creation function has a concrete type, not only use a LocalObservable struct to wrap all,
- observable rename
RawSubscribable
toLocalObservable
-
operator: all operator extension traits are removed.
-
observable: remove
Observable::new
, and add a samecreate
function inobservable
to replace it. -
observable: Rename
Observable
toObservableFromFn
. -
operator: Remove
IntoShared
trait. -
operator: Use
Clone
replaceFork
, now just callobservable.clone()
replaceobservable.fork
. -
subject: merge
Subject::local
andSubject::new
intoSubject::new
. -
subject: For now, LocalSubject emit value by mut ref must explicit call
mut_ref_all
,mut_ref_item
andmut_ref_err
. For example:let subject = Subject::new().mut_ref_item().subscribe(|_|{}); subject.next(&mut 1);
-
observable: rename observable creation function
from_fn
toof_fn
-
observable: rename observable creation function
from_future_with_err
tofrom_future_result
-
observable: Redefine
RawSubscribable
asLocalObservable
. Frompub trait RawSubscribable<Subscriber> { type Unsub: SubscriptionLike + 'static; fn raw_subscribe(self, subscriber: Subscriber) -> Self::Unsub; }
to
pub trait LocalObservable<'a> { type Item; type Err; type Unsub: SubscriptionLike + 'static; fn actual_subscribe<O: Observer<Self::Item, Self::Err> + 'a> ( self, subscriber: Subscriber<O, LocalSubscription>, ) -> Self::Unsub; }
0.7.2 (2020-01-09)
- Subject: merge four version local subject into same version.
- Subject:
Subject::local
,Subject::local_mut_ref
,Subject::local_mut_ref_item
andSubject::local_mut_ref_err
merge intoSubject::local
.
0.7.1 (2019-12-12)
Nothing changed, just fix release package
0.7.0 (2019-12-12)
- Subject: local subject support emit mut ref item.
- observable:
LocalConnectableObservable
andSharedConnectableObservable
has merged intoConnectableObservable
- observable: remove generic type
Item
andErr
fromRawSubscribable
, almost not effect user code.
0.6.0 (2019-12-07)
- observer:
Observer::next
emit items by value instead of reference. - operator: remove
map_return_ref
operator, nowmap
cover its use scenes. - operator: remove
filter_map_return_ref
, nowfilter_map
cover its use scenes.
0.5.0 (2019-11-19)
- operator: add
scan
operator. - observable: add trivial
throw
,empty
,never
andrepeat
observables. - operator: add
last
andlast_or
operators. - operator: add
reduce
andreduce_initial
operators. - operator: add
sum
,min
,max
,count
andaverage
math/aggregate operators. - operator: add
filter_map
andfilter_map_return_ref
observables.
- operator: fix the compiler complain when
map
operator convert source type to a different one.
- observable: macros
of!
,empty!
,from_iter!
,from_future!
andfrom_future_with_err!
replaced by functions.
0.4.0 (2019-11-07)
- observable: add
ConnectableObservable
to support multicast. - operator: add
throttle_time
operator - operator: add
publish
operator - operator: add
ref_count
operator - Subject: support
Fork
even ifItem
andErr
not supportClone
.
Scheduler: add a delay
param for schedule
method, from
pub trait Scheduler {
fn schedule<T: Send + Sync + 'static>(
&self,
task: impl FnOnce(SharedSubscription, T) + Send + 'static,
state: T,
) -> SharedSubscription;
}
to
pub trait Scheduler {
fn schedule<T: Send + 'static>(
&self,
task: impl FnOnce(SharedSubscription, T) + Send + 'static,
delay: Option<Duration>,
state: T,
) -> SharedSubscription;
}
0.3.0 (2019-10-12)
In v0.2
we implemented all operators and observable thread safe, so we can pass task across threads by schedulers. In this way, all user provide closure must satisfied Send + Sync + 'static
, even never use scheduler and multi-thread.
For now, we removed the bounds Sync
, Send
and 'static
, and add a new trait IntoShared
. We always implemented operator for local thread, and implement IntoShared
for it to convert it to a thread-safe operator.
By default, RxRust always use single thread version to get the best performance, and use IntoShared
to convert a local object to a thread-safe object if we need pass this object in threads.
Before:
let res = Arc::new(Mutex(0));
let c_res = res.clone();
observable::of(100).subscribe(|v| { *res.lock().unwrap() = *v });
assert_eq!(*res.lock().unwrap(), 100);
After:
let mut res = 0;
observable::of(100).subscribe(|v| { res = *v });
assert_eq!(res, 100);
- removed
RxFn
andRxValue
- operators: removed
Multicast
- observable: removed
ObservableOnce
- observable:
observable::from_vec
andobservable::from_range
functions merge toobservable::from_iter!
macro. - observable:
observable::empty
function toobservable::empty!
macro. - observable:
observable::of
function toobservable::of!
macro. - observable:
observable::from_future
function toobservable::from_future!
macro - observable:
observable::from_future_with_err
function toobservable::from_future_with_err!
macro - observable:
observable::interval
function toobservable::interval!
macro
- observe_on: unsubscribe should also cancel dispatched message.
- subscribe_on: unsubscribe should also cancel task in scheduler queue.
0.2.0 (2019-09-02)
- observable: add
observable::from_vec
andobservable::from_range
- observable: add
observable::empty
andobservable::of
- observable: add
observable::from_future
andobservable::from_future_with_err
- observable: add
observable::interval
- operator: add
delay
operator - operator: add
filter
operator - operator: add
first
operator - operator: add
multicast
andfork
operator,multicast
andfork
are special operators in rxrust, that because in rxrust all operators both consume the upstream, so the are unicast,multicast
let you can convert an unicast stream to a multicast stream to supportfork
stream from it. - operator: add
map
operator - operator: add
merge
operator - operator: add
observe_on
operator - operator: add
subscribe_on
operator - operator: add
take
operator - Schedulers: add
Schedulers::Sync
implementation - Schedulers: add
Schedulers::NewThread
implementation - Schedulers: add
Schedulers::ThreadPool
implementation