Struct zbus::SignalReceiver [−][src]
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]
P: AsRef<Proxy<'a>>,
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]
'p: 'r,
impl<'r, 'p> !UnwindSafe for SignalReceiver<'r, 'p>[src]
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,
pub 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, 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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,