rx_core_common 0.2.2

rx_core's core traits and implementations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{SharedSubscription, SubscriptionWithTeardown};

pub trait SubscriptionLikeExtensionIntoShared
where
	Self: 'static + SubscriptionWithTeardown + Sized + Send + Sync,
{
	/// Wrap this subscription into a [SharedSubscription], erasing it and
	/// allowing you to freely clone it, to unsubscribe it from multiple places.
	fn into_shared(self) -> SharedSubscription {
		SharedSubscription::new(self)
	}
}

impl<Subscription> SubscriptionLikeExtensionIntoShared for Subscription where
	Subscription: 'static + SubscriptionWithTeardown + Sized + Send + Sync
{
}