Skip to main content

EventType

Trait EventType 

Source
pub trait EventType: Sized {
    type Ack: AckMarker;
    type Binary: BinaryMarker;

    const NAME: &'static str;
}
Expand description

Maps a Rust struct to a Socket.IO event name and compile-time policies.

Prefer #[derive(EventType)] over a manual implementation. The derive generates NAME and the associated types. Add #[derive(SerializePayload)] for emit and #[derive(DeserializePayload)] for recv.

Required Associated Constants§

Source

const NAME: &'static str

The Socket.IO event name used as the first element of the wire array.

Required Associated Types§

Source

type Ack: AckMarker

Ack policy: NoAck or HasAck<A>.

Source

type Binary: BinaryMarker

Binary policy: NoBinary or HasBinary.

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.

Implementors§