MessageSender

Struct MessageSender 

Source
pub struct MessageSender<Message> { /* private fields */ }
Expand description

A message sender represents a reserved space for sending a message. Because the space is reserved, the message can be sent immediately

Implementations§

Source§

impl<Message> MessageSender<Message>

Source

pub fn new<TSendMsg, TCancelSend>( send_msg: TSendMsg, cancel_send: TCancelSend, ) -> MessageSender<Message>
where TSendMsg: 'static + Send + FnOnce(Message), TCancelSend: 'static + Send + FnOnce(),

Creates a new message sender that will perform the supplied actions when the message is sent

Source

pub fn send(self, message: Message)

Sends a message, consuming this object

Trait Implementations§

Source§

impl<Message> Drop for MessageSender<Message>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<Message> Freeze for MessageSender<Message>

§

impl<Message> !RefUnwindSafe for MessageSender<Message>

§

impl<Message> Send for MessageSender<Message>

§

impl<Message> !Sync for MessageSender<Message>

§

impl<Message> Unpin for MessageSender<Message>

§

impl<Message> !UnwindSafe for MessageSender<Message>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.