PostExt

Trait PostExt 

Source
pub trait PostExt {
    // Required method
    fn post(&self, message: impl Post) -> Result<(), JsValue>;
}
Expand description

Convenience trait for something that can have messages posted to it, including transferables.

Required Methods§

Source

fn post(&self, message: impl Post) -> Result<(), JsValue>

Send a value, transferring subobjects as necessary.

This function consumes message, as in general it may leave the object in an incoherent state.

§Errors

If the message could not be sent.

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 PostExt for MessagePort

Source§

fn post(&self, message: impl Post) -> Result<(), JsValue>

Source§

impl PostExt for Worker

Source§

fn post(&self, message: impl Post) -> Result<(), JsValue>

Implementors§