Struct gloo_worker::WorkerLink [−][src]
pub struct WorkerLink<W: Worker> { /* fields omitted */ }
Expand description
Link to worker’s scope for creating callbacks.
Implementations
Send a message to the worker
Send an input to self
Create a callback which will send a message to the worker when invoked.
pub fn callback_future<FN, FU, IN, M>(&self, function: FN) -> Rc<dyn Fn(IN)> where
M: Into<W::Message>,
FU: Future<Output = M> + 'static,
FN: Fn(IN) -> FU + 'static,
This is supported on crate feature futures
only.
pub fn callback_future<FN, FU, IN, M>(&self, function: FN) -> Rc<dyn Fn(IN)> where
M: Into<W::Message>,
FU: Future<Output = M> + 'static,
FN: Fn(IN) -> FU + 'static,
This is supported on crate feature
futures
only.This method creates a callback which returns a Future which returns a message to be sent back to the worker
Panics
If the future panics, then the promise will not resolve, and will leak.
pub fn send_future<F, M>(&self, future: F) where
M: Into<W::Message>,
F: Future<Output = M> + 'static,
This is supported on crate feature futures
only.
pub fn send_future<F, M>(&self, future: F) where
M: Into<W::Message>,
F: Future<Output = M> + 'static,
This is supported on crate feature
futures
only.This method processes a Future that returns a message and sends it back to the worker.
Panics
If the future panics, then the promise will not resolve, and will leak.
Trait Implementations
Auto Trait Implementations
impl<W> !RefUnwindSafe for WorkerLink<W>
impl<W> !Send for WorkerLink<W>
impl<W> !Sync for WorkerLink<W>
impl<W> Unpin for WorkerLink<W>
impl<W> !UnwindSafe for WorkerLink<W>
Blanket Implementations
Mutably borrows from an owned value. Read more