Expand description
BMS difficulty table parsing
Provides building a complete BMS difficulty table data structure from header JSON and chart data JSON,
covering the header, courses, trophies, and chart items.
Also includes HTML parsing (via htmlparser) for extracting the bmstable
header URL from a page.
§Features
- Parse header JSON into
BmsTableHeader, preserving unrecognized fields inextrafor forward compatibility; - Parse chart data into
BmsTableData, supporting a plain array ofChartItemstructure; - Course
md5/sha256shorthand lists are preserved as independent fields; useCourseInfo::all_chartsfor a merged view; - Extract the header JSON URL from HTML
<meta name="bmstable">(zero-copy, returns&str).
§Usage
use bms_table::{BmsTable, BmsTableHeader, BmsTableData};
let header_json = r#"{ "name": "Test", "symbol": "t", "data_url": "charts.json", "course": [], "level_order": [] }"#;
let data_json = r#"[]"#;
let header: BmsTableHeader = serde_json::from_str(header_json)?;
let data: BmsTableData = serde_json::from_str(data_json)?;
let table = BmsTable::new(header, data);
assert!(table.header.course.flatten().is_empty());Structs§
- BmsTable
- Top-level BMS difficulty table data structure.
- BmsTable
Data - BMS table data.
- BmsTable
Header - BMS header information.
- BmsTable
Html - HTML parsing for BMS difficulty tables.
- BmsTable
Info - BMS difficulty table list item.
- BmsTable
List - Wrapper type for the list of BMS difficulty tables.
- Chart
Item - Chart data item.
- Course
Info - Course information.
- Trophy
- Trophy information.
Enums§
- BmsTable
Error - Re-export for convenience. Errors that can occur during BMS table parsing.
- Course
Group - Recursive course tree supporting arbitrary nesting depth.