Crate sarif_rust

Crate sarif_rust 

Source
Expand description

§SARIF Rust Library

A comprehensive Rust library for parsing, generating, and manipulating SARIF (Static Analysis Results Interchange Format) v2.1.0 files.

§Features

  • Complete SARIF v2.1.0 specification support
  • Type-safe parsing and generation
  • Comprehensive validation
  • Ergonomic builder patterns
  • High-performance streaming for large files
  • Rich error handling

§Quick Start

use sarif_rust::SarifLog;

// Parse SARIF from file
let sarif: SarifLog = sarif_rust::from_file("results.sarif")?;

// Access results
for run in &sarif.runs {
    if let Some(results) = &run.results {
        for result in results {
            println!("Found issue: {}",
                result.message.text.as_deref().unwrap_or("no message"));
        }
    }
}

Re-exports§

pub use parser::from_file;
pub use parser::from_str;
pub use parser::to_string;
pub use parser::to_string_pretty;
pub use builder::*;
pub use parser::*;
pub use types::*;

Modules§

builder
Builder pattern implementations for creating SARIF objects
parser
SARIF parsing and serialization functionality
prelude
Re-export commonly used types and functions for convenience
types
Core SARIF data structures and types
utils
Utility functions and helpers for SARIF processing

Constants§

SARIF_VERSION
SARIF specification version supported
VERSION
Library version