pub fn to_string(event: &ThreadEvent) -> Result<String, Error>
Serializes an event into a JSON string.