BarrierLab

API overview

The public items of the crate at a glance. Item-level documentation lives on docs.rs.

The full, versioned API documentation is on docs.rs/html-conform. This page lists what is there.

Functions

check

pub fn check(html: &str) -> Result<CheckReport, CheckError>

Checks a complete HTML document with CheckOptions::default().

check_with_options

pub fn check_with_options(html: &str, options: CheckOptions) -> Result<CheckReport, CheckError>

Checks a complete HTML document with explicit options. Always uses HTML5 error recovery.

Types

CheckOptions

FieldTypeDefaultMeaning
include_parse_errorsbooltrueInclude recovered parser diagnostics (parser.html5)

CheckReport

MemberMeaning
findings: Vec<Finding>Parser findings first, then the later validation layers
has_errors() -> boolWhether any finding has Severity::Error

Finding

FieldType
rule_idString, see Findings and rule IDs
severitySeverity
messageString
locationOption<SourceLocation>

Severity

Error, Warning, Info.

SourceLocation

FieldTypeMeaning
lineu32one-based
columnu32one-based
byte_offsetusizezero-based

Displays as line:column.

CheckError

#[non_exhaustive] enum with one variant, Initialization { message }: a checker component could not be set up. Implements std::error::Error.

Serialization

CheckReport, Finding, Severity and SourceLocation derive serde’s Serialize and Deserialize. serde is a regular dependency, not a feature flag.

Edit this page on GitHub