pub struct BmsTableHtml;Expand description
HTML parsing for BMS difficulty tables.
Provides extraction of the header JSON URL from
<meta name="bmstable" content="..."> in HTML page content.
Implementations§
Source§impl BmsTableHtml
impl BmsTableHtml
Sourcepub fn extract_url(html_content: &str) -> Result<String>
pub fn extract_url(html_content: &str) -> Result<String>
Extract the header JSON URL from <meta name="bmstable" content="..."> in HTML.
Scans <meta> tags looking for elements with name="bmstable" or property="bmstable"
and reads their content attribute.
§Errors
Returns an error when the target tag is not found or content is empty.
§Example
let html = r#"
<!DOCTYPE html>
<html>
<head>
<meta name="bmstable" content="header.json">
</head>
<body></body>
</html>
"#;
let url = BmsTableHtml::extract_url(html).unwrap();
assert_eq!(url, "header.json");Auto Trait Implementations§
impl Freeze for BmsTableHtml
impl RefUnwindSafe for BmsTableHtml
impl Send for BmsTableHtml
impl Sync for BmsTableHtml
impl Unpin for BmsTableHtml
impl UnsafeUnpin for BmsTableHtml
impl UnwindSafe for BmsTableHtml
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more