Skip to main content

Crate bms_table

Crate bms_table 

Source
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 in extra for forward compatibility;
  • Parse chart data into BmsTableData, supporting a plain array of ChartItem structure;
  • Course md5/sha256 shorthand lists are preserved as independent fields; use CourseInfo::all_charts for 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.
BmsTableData
BMS table data.
BmsTableHeader
BMS header information.
BmsTableHtml
HTML parsing for BMS difficulty tables.
BmsTableInfo
BMS difficulty table list item.
BmsTableList
Wrapper type for the list of BMS difficulty tables.
ChartItem
Chart data item.
CourseInfo
Course information.
Trophy
Trophy information.

Enums§

BmsTableError
Re-export for convenience. Errors that can occur during BMS table parsing.
CourseGroup
Recursive course tree supporting arbitrary nesting depth.