pub struct ReactorSpawner<R, CODEC = Bincode>{ /* private fields */ }
Expand description
A spawner to create oneshot workers.
Implementations§
Source§impl<R, CODEC> ReactorSpawner<R, CODEC>
impl<R, CODEC> ReactorSpawner<R, CODEC>
Sourcepub const fn encoding<C>(&self) -> ReactorSpawner<R, C>where
C: Codec,
pub const fn encoding<C>(&self) -> ReactorSpawner<R, C>where
C: Codec,
Sets a new message encoding.
Sourcepub fn with_loader(self, with_loader: bool) -> Self
pub fn with_loader(self, with_loader: bool) -> Self
Indicates that spawn
should expect a
path
to a loader shim script (e.g. when using Trunk, created by using
the data-loader-shim
asset type) and one does not need to be generated. false
by default.
Sourcepub fn as_module(self, as_module: bool) -> Self
pub fn as_module(self, as_module: bool) -> Self
Determines whether the worker will be spawned with
options.type
set to module
. true
by default.
This option should be un-set if the worker was created with the
--target no-modules
flag of wasm-bindgen
. If using Trunk, see the
data-bindgen-target
asset type.
Sourcepub fn spawn(self, path: &str) -> ReactorBridge<R>where
<R::Scope as ReactorScoped>::Input: Serialize + for<'de> Deserialize<'de>,
<R::Scope as ReactorScoped>::Output: Serialize + for<'de> Deserialize<'de>,
pub fn spawn(self, path: &str) -> ReactorBridge<R>where
<R::Scope as ReactorScoped>::Input: Serialize + for<'de> Deserialize<'de>,
<R::Scope as ReactorScoped>::Output: Serialize + for<'de> Deserialize<'de>,
Spawns a reactor worker.
Trait Implementations§
Source§impl<R, CODEC> Debug for ReactorSpawner<R, CODEC>
impl<R, CODEC> Debug for ReactorSpawner<R, CODEC>
Auto Trait Implementations§
impl<R, CODEC> Freeze for ReactorSpawner<R, CODEC>
impl<R, CODEC = Bincode> !RefUnwindSafe for ReactorSpawner<R, CODEC>
impl<R, CODEC = Bincode> !Send for ReactorSpawner<R, CODEC>
impl<R, CODEC = Bincode> !Sync for ReactorSpawner<R, CODEC>
impl<R, CODEC> Unpin for ReactorSpawner<R, CODEC>where
CODEC: Unpin,
impl<R, CODEC = Bincode> !UnwindSafe for ReactorSpawner<R, CODEC>
Blanket Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self
to a value of a Properties
struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self
to a value of a Properties
struct.