pub enum EitherSubscription<A, B> {
Left(A),
Right(B),
Idle,
}Expand description
EitherSubscription that holds one of two subscriptions
This enum is useful for operators that switch between two different
subscription states, such as DelaySubscription (TaskHandle ->
SourceSubscription).
Variants§
Trait Implementations§
Source§impl<A, B> Default for EitherSubscription<A, B>
impl<A, B> Default for EitherSubscription<A, B>
Source§fn default() -> EitherSubscription<A, B>
fn default() -> EitherSubscription<A, B>
Returns the “default value” for a type. Read more
Source§impl<A, B> Subscription for EitherSubscription<A, B>where
A: Subscription,
B: Subscription,
impl<A, B> Subscription for EitherSubscription<A, B>where
A: Subscription,
B: Subscription,
Source§fn unsubscribe(self)
fn unsubscribe(self)
Cancel the subscription (terminal operation, consumes self)
Source§fn unsubscribe_when_dropped(self) -> SubscriptionGuard<Self>where
Self: Sized,
fn unsubscribe_when_dropped(self) -> SubscriptionGuard<Self>where
Self: Sized,
Activates “RAII” behavior for this subscription. That means
unsubscribe() will be called automatically as soon as the returned
value goes out of scope. Read moreAuto Trait Implementations§
impl<A, B> Freeze for EitherSubscription<A, B>
impl<A, B> RefUnwindSafe for EitherSubscription<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for EitherSubscription<A, B>
impl<A, B> Sync for EitherSubscription<A, B>
impl<A, B> Unpin for EitherSubscription<A, B>
impl<A, B> UnwindSafe for EitherSubscription<A, B>where
A: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> BoxedSubscriptionInner for Twhere
T: Subscription,
impl<T> BoxedSubscriptionInner for Twhere
T: Subscription,
fn boxed_unsubscribe(self: Box<T>)
fn boxed_is_closed(&self) -> bool
Source§impl<T> IntoBoxedSubscription<BoxedSubscription> for Twhere
T: Subscription + 'static,
impl<T> IntoBoxedSubscription<BoxedSubscription> for Twhere
T: Subscription + 'static,
Source§fn into_boxed(self) -> BoxedSubscription
fn into_boxed(self) -> BoxedSubscription
Convert this subscription into a boxed subscription.
Source§impl<T> IntoBoxedSubscription<BoxedSubscriptionSend> for Twhere
T: Subscription + Send + 'static,
impl<T> IntoBoxedSubscription<BoxedSubscriptionSend> for Twhere
T: Subscription + Send + 'static,
Source§fn into_boxed(self) -> BoxedSubscriptionSend
fn into_boxed(self) -> BoxedSubscriptionSend
Convert this subscription into a boxed subscription.