[][src]Struct pinky_swear::PinkyBroadcaster

#[must_use = "PinkyBroadcaster must be subscribed"]pub struct PinkyBroadcaster<T: Clone, S = T> { /* fields omitted */ }

A PinkyBroadcaster allows you to broacast a promise resolution to several subscribers.

Implementations

impl<T: Send + Clone + 'static, S: Send + 'static> PinkyBroadcaster<T, S>[src]

pub fn new(promise: PinkySwear<T, S>) -> Self[src]

Create a new PinkyBroadcaster from a PinkySwear.

pub fn subscribe(&self) -> PinkySwear<T, S>

Important traits for PinkySwear<T, S>

impl<T: Send + 'static, S: Send + 'static> Future for PinkySwear<T, S> type Output = T;
[src]

Subscribe to receive a broacast when the underlying promise get henoured.

pub fn unsubscribe(&self, promise: PinkySwear<T, S>)[src]

Unsubscribe a promise from the broadcast.

pub fn swear(&self, data: T)[src]

Resolve the underlying promise and broadcast the result to subscribers.

Trait Implementations

impl<T: Clone, S> Clone for PinkyBroadcaster<T, S>[src]

impl<T: Clone, S> Debug for PinkyBroadcaster<T, S>[src]

impl<T: Send + Clone + 'static, S: Send + 'static> Default for PinkyBroadcaster<T, S>[src]

impl<T: Send + Clone + 'static, S: Send + 'static> NotifyReady for PinkyBroadcaster<T, S>[src]

Auto Trait Implementations

impl<T, S = T> !RefUnwindSafe for PinkyBroadcaster<T, S>

impl<T, S> Send for PinkyBroadcaster<T, S> where
    S: Send,
    T: Send

impl<T, S> Sync for PinkyBroadcaster<T, S> where
    S: Send,
    T: Send

impl<T, S> Unpin for PinkyBroadcaster<T, S>

impl<T, S = T> !UnwindSafe for PinkyBroadcaster<T, S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.