[][src]Struct mdl::signal::SignalerSync

pub struct SignalerSync { /* fields omitted */ }

Implementations

impl SignalerSync[src]

pub fn new() -> SignalerSync[src]

pub fn stop(&mut self)[src]

pub fn subscribe(
    &self,
    signal: &str,
    f: Box<dyn Fn(Signal) + 'static>
) -> Result<u32, Error>
[src]

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]

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 signal_loop_sync(&self) -> bool[src]

Trait Implementations

impl Clone for SignalerSync[src]

impl Debug for SignalerSync[src]

impl Signaler for SignalerSync[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.