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

yew_agent/
traits.rs

1//! Submodule providing the `Spawnable` and `Registrable` traits.
2
3/// A Worker that can be spawned by a spawner.
4pub trait Spawnable {
5    /// Spawner Type.
6    type Spawner;
7
8    /// Creates a spawner.
9    fn spawner() -> Self::Spawner;
10}
11
12/// A trait to enable public workers being registered in a web worker.
13pub trait Registrable {
14    /// Registrar Type.
15    type Registrar;
16
17    /// Creates a registrar for the current worker.
18    fn registrar() -> Self::Registrar;
19}