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
skipped: Vec<Skipped>Unchecked classes that occur in this document (SkippedClass::StyleElementCss, SkippedClass::CspHashSource); empty for a document without them
has_errors() -> boolWhether any finding has Severity::Error
to_report() -> a11y_report::ReportThe same result in the shared finding model

to_report maps Error to Fail/Medium, Warning to Review/Low and Info to Untested/Low, keeps rule_id and message, and writes the location as line:column into source_hint. Each Skipped becomes an InputKind::DocumentIncomplete note, so content the checker did not look at is not read as passed. SkippedClass is #[non_exhaustive].

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; the document was not checked. Implements std::error::Error.

VariantMeaning
DocumentTooDeep { depth: usize, limit: usize }the parsed tree nests elements depth levels deep, more than limit (512); no findings are produced
Initialization { message: String }a checker component could not be set up

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