pub struct AsyncConnector<C: AsyncComponent> { /* private fields */ }Expand description
Contains the post-launch input sender and output receivers with the root widget.
The receiver can be separated from the Fairing by choosing a method for handling it.
Implementations§
Source§impl<C: AsyncComponent> AsyncConnector<C>
impl<C: AsyncComponent> AsyncConnector<C>
Sourcepub fn forward<X: 'static, F: Fn(C::Output) -> X + 'static>(
self,
sender_: &Sender<X>,
transform: F,
) -> AsyncController<C>
pub fn forward<X: 'static, F: Fn(C::Output) -> X + 'static>( self, sender_: &Sender<X>, transform: F, ) -> AsyncController<C>
Forwards output events to the designated sender.
Sourcepub fn connect_receiver<F: FnMut(&mut Sender<C::Input>, C::Output) + 'static>(
self,
func: F,
) -> AsyncController<C>
pub fn connect_receiver<F: FnMut(&mut Sender<C::Input>, C::Output) + 'static>( self, func: F, ) -> AsyncController<C>
Given a mutable closure, captures the receiver for handling.
Sourcepub fn detach(self) -> AsyncController<C>
pub fn detach(self) -> AsyncController<C>
Ignore outputs from the component and finish the builder.
Sourcepub fn into_stream(self) -> AsyncComponentStream<C>
pub fn into_stream(self) -> AsyncComponentStream<C>
Convert his type into a Stream that yields output events
as futures.
Trait Implementations§
Source§impl<C: AsyncComponent> AsyncComponentController<C> for AsyncConnector<C>
impl<C: AsyncComponent> AsyncComponentController<C> for AsyncConnector<C>
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.
Auto Trait Implementations§
impl<C> Freeze for AsyncConnector<C>
impl<C> RefUnwindSafe for AsyncConnector<C>
impl<C> Send for AsyncConnector<C>where
<C as AsyncComponent>::Root: Send,
<C as AsyncComponent>::Input: Send,
<C as AsyncComponent>::Output: Send,
impl<C> Sync for AsyncConnector<C>where
<C as AsyncComponent>::Root: Sync,
<C as AsyncComponent>::Input: Send,
<C as AsyncComponent>::Output: Send,
impl<C> Unpin for AsyncConnector<C>
impl<C> UnwindSafe for AsyncConnector<C>
Blanket Implementations§
Source§impl<C> AsyncPosition<()> for C
impl<C> AsyncPosition<()> for C
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