[−][src]Struct pinky_swear::PinkySwear
A PinkySwear is a Promise that the other party is supposed to honour at some point.
Methods
impl<T: Send + 'static, S: Send + 'static> PinkySwear<T, S>
[src]
pub fn new() -> (Self, Pinky<T>)
[src]
Create a new PinkySwear and its associated Pinky.
pub fn new_with_data(data: T) -> Self
[src]
Create a new PinkySwear and honour it at the same time.
pub fn try_wait(&self) -> Option<T>
[src]
Check whether the Promise has been honoured or not.
pub fn wait(&self) -> T
[src]
Wait until the Promise has been honoured.
pub fn subscribe<N: NotifyReady + Send + 'static>(&self, task: N)
[src]
Get notified once the Promise has been honoured.
pub fn has_subscriber(&self) -> bool
[src]
Will someone get notified once the Promise is honoured?
pub fn drop_subscribers(&self)
[src]
Drop all the pending subscribers
pub fn traverse<F: Send + 'static, TF: Fn(T) -> F + Send + 'static>(
self,
transform: TF
) -> PinkySwear<F, T>
[src]
self,
transform: TF
) -> PinkySwear<F, T>
Apply a tranformation to the result of a PinkySwear.
pub fn set_marker(&self, marker: String)
[src]
Add a marker to logs
impl<T: Send + 'static> PinkySwear<T, ()>
[src]
pub fn after<B: Send + 'static>(promise: PinkySwear<(), B>) -> (Self, Pinky<T>)
[src]
Wait for this promise only once the given one is honoured.
impl<T: Send + 'static, E: Send + 'static> PinkySwear<Result<T, E>, Result<(), E>>
[src]
pub fn after<B: Send + 'static>(
promise: PinkySwear<Result<(), E>, B>
) -> (Self, Pinky<Result<T, E>>)
[src]
promise: PinkySwear<Result<(), E>, B>
) -> (Self, Pinky<Result<T, E>>)
Wait for this promise only once the given one is honoured.
Trait Implementations
impl<T, S> Debug for PinkySwear<T, S>
[src]
impl<T, S> Drop for PinkySwear<T, S>
[src]
impl<T: Send + 'static, S: Send + 'static> Future for PinkySwear<T, S>
[src]
Auto Trait Implementations
impl<T, S = T> !RefUnwindSafe for PinkySwear<T, S>
impl<T, S> Send for PinkySwear<T, S> where
S: Send,
T: Send,
S: Send,
T: Send,
impl<T, S = T> !Sync for PinkySwear<T, S>
impl<T, S> Unpin for PinkySwear<T, S>
impl<T, S = T> !UnwindSafe for PinkySwear<T, S>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,