Function parse_fragment

Source
pub fn parse_fragment(fragment: &str) -> Result<Option<&str>, Error>
Expand description

Parses the optional fragment.

The fragment must start with a # or be empty.

Returns Ok(Some(fragment)). Returns Ok(None) if the fragment is empty. Returns Err(InvalidFragment) if the fragment is invalid.