Struct pinky_swear::PinkyErrorBroadcaster
source · pub struct PinkyErrorBroadcaster<T, E: Clone> { /* private fields */ }
Expand description
A PinkyErrorBroadcaster allows you to broacast the success/error of a promise resolution to several subscribers.
Implementations§
source§impl<T: Send + 'static, E: Send + Clone + 'static> PinkyErrorBroadcaster<T, E>
impl<T: Send + 'static, E: Send + Clone + 'static> PinkyErrorBroadcaster<T, E>
sourcepub fn new() -> (PinkySwear<Result<T, E>>, Self)
pub fn new() -> (PinkySwear<Result<T, E>>, Self)
Create a new promise with associated error broadcaster
sourcepub fn set_marker(&self, marker: String)
pub fn set_marker(&self, marker: String)
Add a marker to logs
sourcepub fn subscribe(&self) -> PinkySwear<Result<(), E>> ⓘ
pub fn subscribe(&self) -> PinkySwear<Result<(), E>> ⓘ
Subscribe to receive a broacast when the underlying promise get henoured.
sourcepub fn unsubscribe(&self, promise: PinkySwear<Result<(), E>>)
pub fn unsubscribe(&self, promise: PinkySwear<Result<(), E>>)
Unsubscribe a promise from the broadcast.
Trait Implementations§
Auto Trait Implementations§
impl<T, E> !RefUnwindSafe for PinkyErrorBroadcaster<T, E>
impl<T, E> Send for PinkyErrorBroadcaster<T, E>where E: Send, T: Send,
impl<T, E> Sync for PinkyErrorBroadcaster<T, E>where E: Send, T: Send,
impl<T, E> Unpin for PinkyErrorBroadcaster<T, E>
impl<T, E> !UnwindSafe for PinkyErrorBroadcaster<T, E>
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