Function device_tree_source::parser::parse_dt [] [src]

pub fn parse_dt(source: &[u8]) -> Result<ParseResult, ParseError>

Parses the slice of u8s as ASCII characters and returns a device tree made of the first root node and a Vec of nodes defined after that. The nodes defined after the first root node may specify a node by label to modify or my start at the root node. These amendments to the root node can be merged into the device tree manually or by tree::apply_amends.

When a tree and any following nodes are parsed successfully without remaining input ParseResult::Complete is returned containing the tree and the following nodes. If there is remaining input ParseResult::RemainingInput is returned with the tree, following nodes, and a slice of the remaining input.

Errors

Returns ParseError::IncompleteInput if the end of the input was reached where more was expected. Returns ParseError::NomError if a nom parsing error was returned. This doesn't help much right now, but will be improved soon.