pub trait EventParser {
type Error;
// Required methods
fn parse_kind(&self) -> Result<EventKind, Self::Error>;
fn parse_user_id(&self) -> Result<Option<UserId>, 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§
Sourcefn parse_kind(&self) -> Result<EventKind, Self::Error>
fn parse_kind(&self) -> Result<EventKind, Self::Error>
Parse kind cheaply without allocations
Sourcefn parse_user_id(&self) -> Result<Option<UserId>, Self::Error>
fn parse_user_id(&self) -> Result<Option<UserId>, Self::Error>
Parse user ID cheaply without allocations
Sourcefn parse_event(&self) -> Result<Event, Self::Error>
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".
Implementors§
Source§impl EventParser for Event
impl EventParser for Event
type Error = Infallible
Source§impl EventParser for simploxide_client::ffi::EventResult
Available on crate feature ffi only.
impl EventParser for simploxide_client::ffi::EventResult
Available on crate feature
ffi only.type Error = ClientError
Source§impl EventParser for simploxide_client::ws::EventResult
Available on crate feature websocket only.
impl EventParser for simploxide_client::ws::EventResult
Available on crate feature
websocket only.