Skip to main content

reverse

Function reverse 

Source
pub fn reverse(
    name: &str,
    params: &HashMap<&str, String>,
) -> Result<String, ReverseError>
Expand description

Resolve a registered name + parameters into a concrete URL string.

Substitutes every {name} placeholder in the pattern with the corresponding entry in params, percent-encoding the value so the resulting URL is safe to use as a Location header or template link. Extra params keys that don’t appear in the pattern surface as ReverseError::UnexpectedParam — strict by default so typos don’t disappear.

§Errors