pub trait Handler:
Send
+ Sync
+ 'static {
// Required methods
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);
}
Expand description
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§
Sourcefn is_started(&mut self) -> bool
fn is_started(&mut self) -> bool
Did this Handler
start?
Return true
when it did started (no matter it has stopped or not)
Sourcefn is_alive(&mut self) -> bool
fn is_alive(&mut self) -> bool
Is this Handler
alive?
Return true
when it has started and not stopped yet.