Struct mdl::signal::SignalerAsync [−][src]
pub struct SignalerAsync { /* fields omitted */ }
Methods
impl SignalerAsync
[src]
impl SignalerAsync
pub fn new() -> SignalerAsync
[src]
pub fn new() -> SignalerAsync
pub fn subscribe(
&self,
signal: &str,
f: Box<Fn(Signal) + Send + 'static>
) -> Result<u32, Error>
[src]
pub fn subscribe(
&self,
signal: &str,
f: Box<Fn(Signal) + Send + 'static>
) -> Result<u32, Error>
subscribe a callback to a signal
This callback will be called with all signals that starts with the
signal
string, for example, if you subscribe a callback to the signal
"custom-signal", this callback will have the following behaviour:
signal | f is called -------------------------------+------------- "custom-signal" | true "custom-signal2" | true "custom-signal-with more text" | true "custom" | false "custom-signa" | false "other signal" | false
This method returns the callback id that can be used to unsubscribe
pub fn unsubscribe(&self, id: u32)
[src]
pub fn unsubscribe(&self, id: u32)
Unsubscribe a callback by id. Use the id returned in the subscribe method to remove this signal
pub fn clear_signal(&self, signal: &str)
[src]
pub fn clear_signal(&self, signal: &str)
pub fn signal_loop(&self)
[src]
pub fn signal_loop(&self)
Trait Implementations
impl Clone for SignalerAsync
[src]
impl Clone for SignalerAsync
fn clone(&self) -> SignalerAsync
[src]
fn clone(&self) -> SignalerAsync
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for SignalerAsync
[src]
impl Debug for SignalerAsync
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Signaler for SignalerAsync
[src]
impl Signaler for SignalerAsync
Auto Trait Implementations
impl Send for SignalerAsync
impl Send for SignalerAsync
impl !Sync for SignalerAsync
impl !Sync for SignalerAsync