Struct pulse::Signal [] [src]

pub struct Signal {
    // some fields omitted
}

A Signal represents listens for a pulse to occur in the system. A Signal has one of three states. Pending, Pulsed, or Errored. Pending means the pulse has not fired, but still exists. Pulsed meaning the pulse has fired, and no longer exists. Errored means the pulse was dropped without firing. This normally means a programming error of some sort.

Methods

impl Signal
[src]

fn new() -> (Signal, Pulse)

Create a Signal and a Pulse that are associated.

fn pulsed() -> Signal

Create a signal that is already pulsed

fn state(&self) -> SignalState

Read out the state of the Signal

fn is_pending(&self) -> bool

Check to see if the signal is pending. A signal

fn id(&self) -> usize

This is a unique id that can be used to identify the signal from others See Select for how this api is useful.

fn wait(self) -> Result<()WaitError>

Block the current thread until a pulse is ready. This will block indefinably if the pulse never fires.

fn wait_timeout_ms(self, ms: u32) -> Result<()TimeoutError>

Block until either the pulse is sent, or the timeout is reached

fn callback<F>(self, cb: F) where F: FnOnce() + 'static

Trait Implementations

impl Send for Signal
[src]

impl Sync for Signal
[src]

impl Debug for Signal
[src]

fn fmt(&self, f: &mut Formatter) -> Result<()Error>

Formats the value using the given formatter.

impl Clone for Signal
[src]

fn clone(&self) -> Signal

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Drop for Signal
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more

impl IntoRawPtr for Signal
[src]

unsafe fn into_raw(self) -> *mut ()

impl FromRawPtr for Signal
[src]

unsafe fn from_raw(ptr: *mut ()) -> Signal