Trait fp_rust::handler::Handler[][src]

pub trait Handler: Send + Sync + 'static {
    fn is_started(&mut self) -> bool;
fn is_alive(&mut self) -> bool;
fn start(&mut self);
fn stop(&mut self);
fn post(&mut self, func: RawFunc); }

Handler trait defines the interface which could receive FnMut and run them on its own thread.

Remarks

This is highly inspired by Android Handler concepts.

Required Methods

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

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

Start Handler.

Stop Cor. This will make self.is_alive() returns false, and all FnMut posted by self.post() will not be executed. (Because it has stopped :P, that's reasonable)

Post a job which will run on this Handler.

Arguments

  • func - The posted job. ``

Implementors