pub struct Subscription<'dis>(/* private fields */);Expand description
Subscription is from Observable pattern, it is used to unsubscribe the observable.
The dispose method of Disposable will be called when the subscription is unsubscribe or dropped.
Implementations§
Source§impl<'dis> Subscription<'dis>
impl<'dis> Subscription<'dis>
pub fn new() -> Self
pub fn new_with_disposal( disposable: impl Disposable + NecessarySendSync + 'dis, ) -> Self
pub fn new_with_disposal_callback( callback: impl FnOnce() + NecessarySendSync + 'dis, ) -> Self
pub fn append_disposable( &mut self, disposable: impl Disposable + NecessarySendSync + 'dis, )
Trait Implementations§
Source§impl<'dis, T> Add<T> for Subscription<'dis>where
T: Disposable + NecessarySendSync + 'dis,
impl<'dis, T> Add<T> for Subscription<'dis>where
T: Disposable + NecessarySendSync + 'dis,
Source§type Output = Subscription<'dis>
type Output = Subscription<'dis>
The resulting type after applying the
+ operator.Source§fn add(self, other: T) -> Subscription<'dis>
fn add(self, other: T) -> Subscription<'dis>
Performs the
+ operation. Read moreSource§impl<'dis> Debug for Subscription<'dis>
impl<'dis> Debug for Subscription<'dis>
Source§impl<'dis> Default for Subscription<'dis>
impl<'dis> Default for Subscription<'dis>
Source§impl Disposable for Subscription<'_>
impl Disposable for Subscription<'_>
Auto Trait Implementations§
impl<'dis> Freeze for Subscription<'dis>
impl<'dis> !RefUnwindSafe for Subscription<'dis>
impl<'dis> Send for Subscription<'dis>
impl<'dis> Sync for Subscription<'dis>
impl<'dis> Unpin for Subscription<'dis>
impl<'dis> !UnwindSafe for Subscription<'dis>
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