Skip to main content

Module wasm

Module wasm 

Source
Expand description

WASM bindings for schemaorg-rs.

Exposes three functions to JavaScript:

  • extract โ€“ parse HTML and return structured data as JSON
  • validate_html โ€“ full pipeline: extract -> validate -> profile evaluate
  • schema_version โ€“ returns the Schema.org vocabulary version

All functions return JSON strings. The JS wrapper in wasm/index.js calls JSON.parse() on the results.

Functionsยง

extract
Extracts structured data from HTML and returns it as a JSON string.
schema_version
Returns the Schema.org vocabulary version used by this build.
validate_html
Full validation pipeline: extract -> vocab validate -> profile evaluate.
wasm_start
Initializes the WASM module. Call once before other functions. Sets up a panic hook that logs to console.error.