Skip to main content

try_parse

Function try_parse 

Source
pub fn try_parse(
    entry: &LogEntry,
    timestamp: Option<DateTime<Utc>>,
) -> Option<GameEvent>
Expand description

Attempts to parse a LogEntry as a bot draft event.

Returns Some(GameEvent::DraftBot(_)) if the entry matches either:

  • A pack presentation (BotDraftDraftStatus or BotDraftDraftPick response).
  • A pick confirmation (BotDraftDraftPick request).

Returns None if the entry does not match either signature.

The timestamp is None when the log entry header did not contain a parseable timestamp. It is passed through to EventMetadata so downstream consumers can distinguish real vs missing timestamps.