Skip to main content

parse_attributes

Function parse_attributes 

Source
pub fn parse_attributes<'a>(input: &'a str, out: &mut [Attribute<'a>]) -> usize
Expand description

Parse attributes from a string into an array of Attribute structs

ยงExamples

use neutron_engine::{parse_attributes, Attribute};
 
let mut attrs = [Attribute { name: "", value: "" }; 12];
let count = parse_attributes(r#"style="b:#000" id="Main""#, &mut attrs);
assert_eq!(count, 2);
assert_eq!(attrs[0].name, "style");
assert_eq!(attrs[0].value, "b:#000");