Function tl::parse_owned

source ·
pub unsafe fn parse_owned(
    input: String,
    options: ParserOptions
) -> Result<VDomGuard, ParseError>
Expand description

Parses the given input string and returns an owned, RAII guarded DOM

§Errors

See parse

§Safety

This uses unsafe code to create a self-referential-like struct. The given input string is first leaked and turned into raw pointer, and its lifetime will be promoted to ’static. Once VDomGuard goes out of scope, the string will be freed. It should not be possible to cause UB in its current form and might become a safe function in the future.