playwright-rs-trace 0.2.0

Parser for Playwright trace zip files (formats v8 and v9)
Documentation
//! Error types for trace parsing.

use std::io;

#[derive(Debug, thiserror::Error)]
pub enum TraceError {
    #[error("io: {0}")]
    Io(#[from] io::Error),

    #[error("zip: {0}")]
    Zip(#[from] zip::result::ZipError),

    #[error("json on line {line}: {source}")]
    Json {
        line: usize,
        #[source]
        source: serde_json::Error,
    },

    #[error("missing entry: {0}")]
    MissingEntry(&'static str),

    #[error("unsupported trace version {found}, supported {supported:?}")]
    UnsupportedVersion {
        found: u32,
        supported: std::ops::RangeInclusive<u32>,
    },

    #[error("malformed action {call_id}: {reason}")]
    MalformedAction { call_id: String, reason: String },
}

pub type Result<T> = std::result::Result<T, TraceError>;