pub trait WorkerData:
Send
+ Sized
+ 'static {
// Required methods
fn into_bytes(self) -> Vec<u8> ⓘ;
fn from_bytes(bytes: Vec<u8>) -> Self;
}Expand description
Data a WorkerJob takes or returns. It crosses to the worker and back
as bytes: a Web Worker has a memory of its own, so nothing that points
into the page’s memory can cross.
Required Methods§
Sourcefn into_bytes(self) -> Vec<u8> ⓘ
fn into_bytes(self) -> Vec<u8> ⓘ
The bytes from_bytes reads the value back from.
Sourcefn from_bytes(bytes: Vec<u8>) -> Self
fn from_bytes(bytes: Vec<u8>) -> Self
The value into_bytes wrote as bytes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".