Skip to main content

from_str

Function from_str 

Source
pub fn from_str(input: &str) -> Result<UpfDocument, UpfError>
Expand description

Parse a Unified Pseudopotential Format (UPF) document from a UTF-8 string. Parse a Unified Pseudopotential Format (UPF) document from a UTF-8 string.

The parser first normalizes a few common UPF text quirks:

  • removes byte-order marks
  • removes legacy comment forms such as <-- ... -->
  • escapes raw ampersands inside text payloads
  • trims malformed suffixes from closing tags