pub trait RouteBuilder<'a> {
// Required methods
fn new(host: &'a str) -> Self;
fn build(self) -> Result<Uri, Error>;
fn with_param<T: ToString>(self, name: String, value: T) -> Self;
fn with_path(self, path: String) -> Self;
fn with_path_weight(self, path: String, weight: f32) -> Self;
fn with_scheme(self, scheme: String) -> Self;
}
Expand description
Constructs URL routes from the ground up. Useful in scenarios where the need to dynamically construct routes that may have common properties.
Required Methods§
Sourcefn with_param<T: ToString>(self, name: String, value: T) -> Self
fn with_param<T: ToString>(self, name: String, value: T) -> Self
Add a parameter key/pair to the builder.
Sourcefn with_path_weight(self, path: String, weight: f32) -> Self
fn with_path_weight(self, path: String, weight: f32) -> Self
Inserts a path argument with the desired weight.
Sourcefn with_scheme(self, scheme: String) -> Self
fn with_scheme(self, scheme: String) -> Self
Set the protocol scheme.
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.