Function twilight_gateway::parse

source ·
pub fn parse(
    event: String,
    wanted_event_types: EventTypeFlags
) -> Result<Option<GatewayEvent>, ReceiveMessageError>
Expand description

Parse a JSON encoded gateway event into a GatewayEvent if wanted_event_types contains its type.

§Errors

Returns a ReceiveMessageErrorType::Deserializing error if the known event could not be deserialized.