[−][src]Struct apex::Signal
Signal component of the Signals and Slots implementation. This uses mpsc channels provided by 'crossbeam' internally for communication between this and connected Slots
Implementations
impl<T: Send + Sync + Copy + 'static> Signal<T>
[src]
pub fn new() -> Signal<T>
[src]
pub fn add_sender(&mut self, sender: Sender<T>)
[src]
Adds the given sender to the Signal's list of senders
Arguments
- 'sender' - the channel Sender to add to the list
pub fn emit(&self, signal: T) -> Result<(), SignalError<T>>
[src]
Emits the given signal to all of the connected Slots
May return a SignalError if the Signal is not connected to any Slots or an error occured when sending to any Slot. If an error occurs when sending to a Slot, all Slots will still be sent to and only the most recent error will be returned.
Arguments
- 'signal' - The signal to be emitted
Returns
- success - Ok(())
- failure - SignalError
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Signal<T>
impl<T> Send for Signal<T>
impl<T> Sync for Signal<T>
impl<T> Unpin for Signal<T>
impl<T> UnwindSafe for Signal<T>
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, 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>,