| Crates.io | rx_core_macro_subscription_derive |
| lib.rs | rx_core_macro_subscription_derive |
| version | 0.2.0 |
| created_at | 2026-01-18 23:16:15.775448+00 |
| updated_at | 2026-01-24 14:57:57.328402+00 |
| description | rx_core subscription derive, implements associated type only traits |
| homepage | https://github.com/AlexAegis/rx_bevy |
| repository | https://github.com/AlexAegis/rx_bevy |
| max_upload_size | |
| id | 2053294 |
| size | 10,202 |
Helper macro to implement a few traits required for a subscription.
SubscriptionLike (unless using
#[rx_delegate_subscription_like_to_destination])TeardownCollection (unless using #[rx_delegate_teardown_collection])WithPrimaryCategory: Sets the associated type to
PrimaryCategorySubscriptionAll attributes are prefixed with
rx_for easy auto-complete access.
#[rx_delegate_teardown_collection]: Implements add_teardown
The default implementation is:
fn add_teardown(&mut self, teardown: Teardown) {
if !self.is_closed() {
self.(#[teardown] or if missing, #[destination]).add_teardown(teardown);
} else {
teardown.execute();
}
}
#[rx_skip_unsubscribe_on_drop_impl]: Skips the default
unsubscribe-on-drop implementation. Only use when the subscription
explicitly does NOT have to unsubscribe on drop, or you want to provide
your own implementation.
The default implementation:
fn drop(&mut self) {
if !self.is_closed() {
self.unsubscribe();
}
}
RxExecutor -
Derive macro for Executors.RxObservable -
Derive macro for Observables.RxObserver -
Derive macro for RxObservers.RxOperator -
Derive macro for Operators.RxScheduler -
Derive macro for Schedulers.RxSubject -
Derive macro for Subjects.RxSubscriber -
Derive macro for Subscribers.RxWork -
Derive macro for schedulable work.In case you want to inspect the output of the proc macro.
If you haven't installed cargo-expand yet, install it first:
cargo install cargo-expand
Then expand the macro output:
cargo expand -p rx_core_observable_interval