pub trait Publisher {
type Link: Subscriber;
// Required methods
unsafe fn subscribe(&self, link: Pin<&Self::Link>);
unsafe fn unsubscribe(&self, link: Pin<&Self::Link>);
}Expand description
A trait that allows continuations to subscribe for state changes and be reactivated when they occur.
Required Associated Types§
Sourcetype Link: Subscriber
type Link: Subscriber
The type of the object this notifier informs.
Required Methods§
Sourceunsafe fn subscribe(&self, link: Pin<&Self::Link>)
unsafe fn subscribe(&self, link: Pin<&Self::Link>)
Unsafely subscribes a link to the notifier.
§Safety
The caller is responsible to ensure that the passed reference is not dropped until the link is unsubscribed.
Sourceunsafe fn unsubscribe(&self, link: Pin<&Self::Link>)
unsafe fn unsubscribe(&self, link: Pin<&Self::Link>)
Unsafely unsubscribes a link from the notifier.
§Safety
The caller is responsible to ensure that the link is currently subscribed to the same notifier it is unsubscribed from.