pub trait PathExt {
// Required method
fn with_query(self, key: impl Display, value: impl Display) -> String;
}Expand description
Fluent query-string builder for path strings produced by typed path helpers.
Automatically imported via autumn_web::prelude.
Required Methods§
Sourcefn with_query(self, key: impl Display, value: impl Display) -> String
fn with_query(self, key: impl Display, value: impl Display) -> String
Append a percent-encoded key=value query parameter.
The first call adds ?key=value; subsequent calls add &key=value.
Both key and value are percent-encoded (RFC 3986 §2.1).
§Examples
use autumn_web::paths::PathExt;
let url = "/posts".to_string().with_query("page", 2).with_query("q", "hello world");
assert_eq!(url, "/posts?page=2&q=hello%20world");Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.