Trait fp_rust::sync::Will[][src]

pub trait Will<T>: Send + Sync + 'static {
    fn is_started(&mut self) -> bool;
fn is_alive(&mut self) -> bool;
fn start(&mut self);
fn stop(&mut self);
fn add_callback(&mut self, subscription: Arc<SubscriptionFunc<T>>);
fn remove_callback(&mut self, subscription: Arc<SubscriptionFunc<T>>);
fn result(&mut self) -> Option<T>; }
Expand description

Will trait defines the interface which could do actions in its Handler.

Remarks

This is highly inspired by Java Future concepts.

Required methods

Did this Will start? Return true when it did started (no matter it has stopped or not)

Is this Will alive? Return true when it has started and not stopped yet.

Start Will.

Stop Will.

Add a callback called when it has completed.

Arguments

  • subscription - The callback. ``

Remove a callback called when it has completed.

Arguments

  • subscription - The callback. ``

Get the result.

Implementors