pub struct Subscription<T> {
id: SubscriptionID,
recv_chan: Receiver<T>,
publisher: Arc<Publisher<T>>,
}
Fields§
§id: SubscriptionID
§recv_chan: Receiver<T>
§publisher: Arc<Publisher<T>>
Implementations§
Source§impl<T: Clone> Subscription<T>
impl<T: Clone> Subscription<T>
Sourcepub fn new(
id: SubscriptionID,
publisher: Arc<Publisher<T>>,
recv_chan: Receiver<T>,
) -> Subscription<T>
pub fn new( id: SubscriptionID, publisher: Arc<Publisher<T>>, recv_chan: Receiver<T>, ) -> Subscription<T>
Creates a new Subscription
Sourcepub async fn unsubscribe(&self)
pub async fn unsubscribe(&self)
Unsubscribe from the Publisher
Auto Trait Implementations§
impl<T> Freeze for Subscription<T>
impl<T> !RefUnwindSafe for Subscription<T>
impl<T> Send for Subscription<T>where
T: Send,
impl<T> Sync for Subscription<T>where
T: Send,
impl<T> !Unpin for Subscription<T>
impl<T> !UnwindSafe for Subscription<T>
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