[][src]Struct zbus::SignalReceiver

pub struct SignalReceiver<'r, 'p> { /* fields omitted */ }

Receives signals for Proxy instances.

Use this to receive signals on a given connection for a bunch of proxies at the same time.

Implementations

impl<'r, 'p> SignalReceiver<'r, 'p>[src]

pub fn new(conn: Connection) -> Self[src]

Create a new SignalReceiver instance.

pub fn connection(&self) -> &Connection[src]

Get a reference to the associated connection.

pub fn proxies(&self) -> impl Iterator<Item = &&Proxy<'_>>[src]

Get a iterator for all the proxies in this receiver.

pub fn receive_for<'a: 'p, 'b: 'r, P>(&mut self, proxy: &'b P) where
    P: AsRef<Proxy<'a>>, 
[src]

Watch for signals relevant to the proxy.

Panics

This method will panic if you try to add a proxy with a different associated connection than the one associated with this receiver.

pub fn next_signal(&self) -> Result<Option<Message>>[src]

Received and handle the next incoming signal on the associated connection.

This method will wait for signal messages on the associated connection and call any handler registered (through Proxy::connect_signal) with a proxy in this receiver.

If the signal message was handled by a handler, Ok(None) is returned. Otherwise, the received message is returned.

pub fn handle_signal(&self, msg: &Message) -> Result<bool>[src]

Handle the provided signal message.

Call any handler registered (through Proxy::connect_signal) with a proxy in this receiver.

If no errors are encountered, Ok(true) is returned if a handler was found and called for, the signal; Ok(false) otherwise.

Auto Trait Implementations

impl<'r, 'p> RefUnwindSafe for SignalReceiver<'r, 'p>[src]

impl<'r, 'p> Send for SignalReceiver<'r, 'p>[src]

impl<'r, 'p> Sync for SignalReceiver<'r, 'p>[src]

impl<'r, 'p> Unpin for SignalReceiver<'r, 'p> where
    'p: 'r, 
[src]

impl<'r, 'p> UnwindSafe for SignalReceiver<'r, 'p>[src]

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, 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.