Skip to main content

ReactRequest

Trait ReactRequest 

Source
pub trait ReactRequest:
    DeserializeOwned
    + TS
    + Send
    + Sync
    + 'static {
    type Response: Serialize + TS + Send + Sync + 'static;

    const NAME: &'static str;
}
Expand description

A typed request payload a React request(NAME, value) call deserializes into, paired with the typed reply it resolves to.

Usually derived with #[react_request], which derives Deserialize + TS and implements this trait. The response type is one you define separately and derive Serialize + TS on.

Required Associated Constants§

Source

const NAME: &'static str

The request name, e.g. "board.get". Dotted names become nested proxy methods (bevy.board.get). Defaults to the struct ident with its first letter lowercased.

Required Associated Types§

Source

type Response: Serialize + TS + Send + Sync + 'static

The typed value this request resolves to on the JS side.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§