pub struct Connector<C: Component> { /* private fields */ }
Expand description
Contains the post-launch input sender and output receivers with the root widget.
The receiver can be separated from the Connector
by choosing a method for handling it.
Implementations§
source§impl<C: Component> Connector<C>
impl<C: Component> Connector<C>
sourcepub fn forward<X: 'static, F: Fn(C::Output) -> X + 'static>(
self,
sender_: &Sender<X>,
transform: F
) -> Controller<C>
pub fn forward<X: 'static, F: Fn(C::Output) -> X + 'static>(
self,
sender_: &Sender<X>,
transform: F
) -> Controller<C>
Forwards output events to the designated sender.
sourcepub fn connect_receiver<F: FnMut(&mut Sender<C::Input>, C::Output) + 'static>(
self,
func: F
) -> Controller<C>
pub fn connect_receiver<F: FnMut(&mut Sender<C::Input>, C::Output) + 'static>(
self,
func: F
) -> Controller<C>
Given a mutable closure, captures the receiver for handling.
sourcepub fn detach(self) -> Controller<C>
pub fn detach(self) -> Controller<C>
Ignore outputs from the component and take the handle.
sourcepub fn into_stream(self) -> ComponentStream<C>
pub fn into_stream(self) -> ComponentStream<C>
Convert his type into a Stream
that yields output events
as futures.
Trait Implementations§
source§impl<C: Component> ComponentController<C> for Connector<C>
impl<C: Component> ComponentController<C> for Connector<C>
source§fn state(&self) -> &StateWatcher<C>
fn state(&self) -> &StateWatcher<C>
Provides access to the state of a component.
source§fn detach_runtime(&mut self)
fn detach_runtime(&mut self)
Dropping this type will usually stop the runtime of the component.
With this method you can give the runtime a static lifetime.
In other words, dropping the controller or connector will not stop
the runtime anymore, instead it will run until the app is closed.