This is unreleased documentation for Yew Next version.
For up-to-date documentation, see the latest version on docs.rs.
yew_agent::scope_ext

Trait AgentScopeExt

Source
pub trait AgentScopeExt {
    // Required methods
    fn bridge_worker<W>(
        &self,
        callback: Callback<W::Output>,
    ) -> WorkerBridgeHandle<W>
       where W: Worker + 'static;
    fn bridge_reactor<R>(
        &self,
        callback: Callback<ReactorEvent<R>>,
    ) -> ReactorBridgeHandle<R>
       where R: Reactor + 'static,
             <R::Scope as ReactorScoped>::Output: 'static;
    fn run_oneshot<T>(&self, input: T::Input, callback: Callback<T::Output>)
       where T: Oneshot + 'static;
}
Expand description

An extension to Scope that provides communication mechanism to agents.

You can access them on ctx.link()

Required Methods§

Source

fn bridge_worker<W>( &self, callback: Callback<W::Output>, ) -> WorkerBridgeHandle<W>
where W: Worker + 'static,

Bridges to a Worker Agent.

Source

fn bridge_reactor<R>( &self, callback: Callback<ReactorEvent<R>>, ) -> ReactorBridgeHandle<R>
where R: Reactor + 'static, <R::Scope as ReactorScoped>::Output: 'static,

Bridges to a Reactor Agent.

Source

fn run_oneshot<T>(&self, input: T::Input, callback: Callback<T::Output>)
where T: Oneshot + 'static,

Runs an oneshot in an Oneshot Agent.

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.

Implementations on Foreign Types§

Source§

impl<COMP> AgentScopeExt for Scope<COMP>
where COMP: Component,

Source§

fn bridge_worker<W>( &self, callback: Callback<W::Output>, ) -> WorkerBridgeHandle<W>
where W: Worker + 'static,

Source§

fn bridge_reactor<R>( &self, callback: Callback<ReactorEvent<R>>, ) -> ReactorBridgeHandle<R>
where R: Reactor + 'static, <R::Scope as ReactorScoped>::Output: 'static,

Source§

fn run_oneshot<T>(&self, input: T::Input, callback: Callback<T::Output>)
where T: Oneshot + 'static,

Implementors§