AXIS-CORE SDK (Rust)
A fast, memory-safe Rust library for automated web accessibility checking. Built with performance and reliability in mind.
Installation
Add this to your Cargo.toml:
[]
= "1.0"
Quick Start
use AxisCore;
async
Features
- WCAG 2.1 Compliance: Automated checks against accessibility guidelines
- URL & HTML Analysis: Test live websites or raw HTML content
- Performance Focused: Zero-cost abstractions and async support
- Memory Safe: Rust's ownership system prevents common bugs
- Comprehensive Reporting: Detailed issue breakdowns and scoring
- Environmental Impact: CO₂ emissions and energy consumption tracking
API Reference
AxisCore
Main SDK struct for accessibility checking.
Methods
new() -> AxisCore: Create a new checker instancecheck_url(url: &str) -> Result<Report>: Check a website by URLcheck_html(html: &str, base_url: Option<&str>) -> Report: Check HTML contentexport_to_text(report: &Report) -> String: Export report as textversion() -> &'static str: Get SDK version
Report
Contains the results of an accessibility analysis.
Fields
issues: Vec<Issue>- All issues foundtotal_issues: usize- Total number of issueserror_count/warning_count/info_count: usize- Issues by severityaccessibility_score: u32- Score from 0-100compliance_status: String- Overall compliance levelpage_load_time: f64- Load time in secondsenergy_consumption_kwh: f64- Estimated energy useco2_emissions_grams: f64- Estimated carbon emissions
Issue
Represents a single accessibility issue.
Fields
issue_type: String- Type of issue (e.g., "Missing Alt Text")element_snippet: Option<String>- HTML snippet where issue was foundsuggested_fix: Option<String>- How to fix the issueseverity: Severity- Error, Warning, or Infofix_example: Option<String>- Example fix codecategory: Category- Issue category
Examples
Basic URL Check
use AxisCore;
async
HTML Content Analysis
use AxisCore;
let checker = new;
let html = r#"<html><body><img src="test.jpg" /></body></html>"#;
let report = checker.check_html;
// Check for missing alt text
for issue in &report.issues
Export Report
use AxisCore;
async
Understanding Scores
- 95-100: Fully Compliant - Meets all WCAG guidelines
- 80-94: Mostly Compliant - Minor issues to address
- 60-79: Partially Compliant - Significant improvements needed
- <60: Not Compliant - Major accessibility barriers present
Issue Categories
- Accessibility: Core WCAG compliance issues
- SEO: Search engine optimization problems
- Performance: Speed and loading issues
- Environment: Energy usage and carbon footprint
- Safety: Security and privacy concerns
Performance
AXIS-CORE is designed for high performance:
- Async/Await: Non-blocking I/O operations
- Zero-copy parsing: Efficient HTML processing with
scraper - Memory safe: Rust's ownership system prevents leaks
- Fast checks: Optimized algorithms for common issues
Error Handling
The SDK uses Rust's Result type for error handling:
match checker.check_url.await
Contributing
Issues and pull requests welcome! This SDK is built with Rust's safety and performance guarantees.
License
GPL-3.0-or-later
Built with ❤️ for a more accessible web