WithReceiver

Trait WithReceiver 

Source
pub trait WithReceiver: Sized {
    // Required methods
    fn receiver(&self) -> Option<Receiver>;
    fn set_receiver(&mut self, receiver: Receiver);

    // Provided method
    fn with_receiver(self, receiver: Receiver) -> Self { ... }
}
Expand description

An element with an optional function receiver.

Required Methods§

Source

fn receiver(&self) -> Option<Receiver>

Gets the optional function receiver.

Source

fn set_receiver(&mut self, receiver: Receiver)

Sets the function receiver.

Provided Methods§

Source

fn with_receiver(self, receiver: Receiver) -> Self

Sets the function receiver.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§