Struct dioxus_std::utils::channel::UseChannel
source · pub struct UseChannel<MessageType: Clone> { /* private fields */ }Expand description
Send and listen for messages between multiple components.
Implementations§
source§impl<MessageType: Clone> UseChannel<MessageType>
impl<MessageType: Clone> UseChannel<MessageType>
sourcepub fn try_send(
&self,
msg: impl Into<MessageType>
) -> Result<(), TrySendError<MessageType>>
pub fn try_send( &self, msg: impl Into<MessageType> ) -> Result<(), TrySendError<MessageType>>
Tries to send a message to all listeners of the channel.
sourcepub async fn send(
&self,
msg: impl Into<MessageType>
) -> Result<(), SendError<MessageType>>
pub async fn send( &self, msg: impl Into<MessageType> ) -> Result<(), SendError<MessageType>>
Sends a message to all listeners of the channel.
sourcepub fn receiver(&mut self) -> Receiver<MessageType>
pub fn receiver(&mut self) -> Receiver<MessageType>
Create a receiver for the channel.
You probably want to use super::use_listen_channel().
Trait Implementations§
source§impl<MessageType: Clone + Clone> Clone for UseChannel<MessageType>
impl<MessageType: Clone + Clone> Clone for UseChannel<MessageType>
source§fn clone(&self) -> UseChannel<MessageType>
fn clone(&self) -> UseChannel<MessageType>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<MessageType> RefUnwindSafe for UseChannel<MessageType>
impl<MessageType> Send for UseChannel<MessageType>where MessageType: Send + Sync,
impl<MessageType> Sync for UseChannel<MessageType>where MessageType: Send + Sync,
impl<MessageType> Unpin for UseChannel<MessageType>
impl<MessageType> UnwindSafe for UseChannel<MessageType>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more