pub struct Sender<CustomEvent: CustomEvent> { /* private fields */ }
Expand description
Represents a message sender and receiver for passing actions between threads.
Implementations
sourceimpl<CustomEvent: CustomEvent> Sender<CustomEvent>
impl<CustomEvent: CustomEvent> Sender<CustomEvent>
sourcepub fn new(
sender: Sender<EventAction<CustomEvent>>,
receiver: Receiver<()>
) -> Self
pub fn new(
sender: Sender<EventAction<CustomEvent>>,
receiver: Receiver<()>
) -> Self
Create a new instance.
sourcepub fn clone_poisoned(&self) -> Arc<AtomicBool>
pub fn clone_poisoned(&self) -> Arc<AtomicBool>
Clone the poisoned flag.
sourcepub fn is_poisoned(&self) -> bool
pub fn is_poisoned(&self) -> bool
Is the sender poisoned, and not longer accepting actions.
sourcepub fn read_event(&mut self) -> Event<CustomEvent>
pub fn read_event(&mut self) -> Event<CustomEvent>
Read an event from the queue
sourcepub fn enqueue_event(&self, event: Event<CustomEvent>) -> Result<()>
pub fn enqueue_event(&self, event: Event<CustomEvent>) -> Result<()>
sourcepub fn push_event(&self, event: Event<CustomEvent>) -> Result<()>
pub fn push_event(&self, event: Event<CustomEvent>) -> Result<()>
Trait Implementations
sourceimpl<CustomEvent: Clone + CustomEvent> Clone for Sender<CustomEvent>
impl<CustomEvent: Clone + CustomEvent> Clone for Sender<CustomEvent>
Auto Trait Implementations
impl<CustomEvent> !RefUnwindSafe for Sender<CustomEvent>
impl<CustomEvent> Send for Sender<CustomEvent> where
CustomEvent: Send,
impl<CustomEvent> Sync for Sender<CustomEvent> where
CustomEvent: Send,
impl<CustomEvent> Unpin for Sender<CustomEvent>
impl<CustomEvent> !UnwindSafe for Sender<CustomEvent>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more