[−][src]Struct mdl::signal::SignalerSync
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]
&self,
signal: &str,
f: Box<dyn Fn(Signal) + '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]
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]
fn clone(&self) -> SignalerSync
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SignalerSync
[src]
impl Signaler for SignalerSync
[src]
Auto Trait Implementations
impl !RefUnwindSafe for SignalerSync
impl !Send for SignalerSync
impl !Sync for SignalerSync
impl Unpin for SignalerSync
impl !UnwindSafe for SignalerSync
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,