Skip to main content

EventParser

Trait EventParser 

Source
pub trait EventParser {
    type Error;

    // Required methods
    fn parse_kind(&self) -> Result<EventKind, Self::Error>;
    fn parse_event(&self) -> Result<Event, Self::Error>;
}
Expand description

A helper trait meant to be implemented by raw event types

Required Associated Types§

Required Methods§

Source

fn parse_kind(&self) -> Result<EventKind, Self::Error>

Should parse kind cheaply without allocations

Source

fn parse_event(&self) -> Result<Event, Self::Error>

Parse the whole events

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl EventParser for Result<Event>

Available on crate feature ffi only.

Implementors§

Source§

impl EventParser for Event

Source§

impl EventParser for CoreResult<String>

Available on crate feature websocket only.