Publisher

Trait Publisher 

Source
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§

The type of the object this notifier informs.

Required Methods§

Source

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.

Source

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.

Implementations on Foreign Types§

Source§

impl Publisher for ()

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher> Publisher for (A,)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher, B: Publisher> Publisher for (A, B)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher, B: Publisher, C: Publisher> Publisher for (A, B, C)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher, B: Publisher, C: Publisher, D: Publisher> Publisher for (A, B, C, D)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher, B: Publisher, C: Publisher, D: Publisher, E: Publisher> Publisher for (A, B, C, D, E)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher, B: Publisher, C: Publisher, D: Publisher, E: Publisher, F: Publisher> Publisher for (A, B, C, D, E, F)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher, B: Publisher, C: Publisher, D: Publisher, E: Publisher, F: Publisher, G: Publisher> Publisher for (A, B, C, D, E, F, G)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher, B: Publisher, C: Publisher, D: Publisher, E: Publisher, F: Publisher, G: Publisher, H: Publisher> Publisher for (A, B, C, D, E, F, G, H)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher, B: Publisher, C: Publisher, D: Publisher, E: Publisher, F: Publisher, G: Publisher, H: Publisher, I: Publisher> Publisher for (A, B, C, D, E, F, G, H, I)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher, B: Publisher, C: Publisher, D: Publisher, E: Publisher, F: Publisher, G: Publisher, H: Publisher, I: Publisher, J: Publisher> Publisher for (A, B, C, D, E, F, G, H, I, J)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher, B: Publisher, C: Publisher, D: Publisher, E: Publisher, F: Publisher, G: Publisher, H: Publisher, I: Publisher, J: Publisher, K: Publisher> Publisher for (A, B, C, D, E, F, G, H, I, J, K)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<A: Publisher, B: Publisher, C: Publisher, D: Publisher, E: Publisher, F: Publisher, G: Publisher, H: Publisher, I: Publisher, J: Publisher, K: Publisher, L: Publisher> Publisher for (A, B, C, D, E, F, G, H, I, J, K, L)

Source§

unsafe fn subscribe(&self, _link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, _link: Pin<&Self::Link>)

Source§

impl<N: ?Sized + Publisher> Publisher for &N

Source§

unsafe fn subscribe(&self, link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, link: Pin<&Self::Link>)

Source§

impl<N: ?Sized + Publisher> Publisher for Box<N>

Source§

unsafe fn subscribe(&self, link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, link: Pin<&Self::Link>)

Source§

impl<N: ?Sized + Publisher> Publisher for Rc<N>

Source§

unsafe fn subscribe(&self, link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, link: Pin<&Self::Link>)

Source§

impl<N: ?Sized + Publisher> Publisher for Arc<N>

Source§

unsafe fn subscribe(&self, link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, link: Pin<&Self::Link>)

Source§

impl<N: ?Sized + Publisher> Publisher for Pin<&N>

Source§

unsafe fn subscribe(&self, link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, link: Pin<&Self::Link>)

Source§

impl<N: ?Sized + Publisher> Publisher for UnsafeRef<N>

Source§

unsafe fn subscribe(&self, link: Pin<&Self::Link>)

Source§

unsafe fn unsubscribe(&self, link: Pin<&Self::Link>)

Implementors§