Skip to main content

HttpUriExt

Trait HttpUriExt 

Source
pub trait HttpUriExt {
    // Required methods
    fn extend_dir_with_path(self, path: &str) -> Result<Uri, Error>;
    fn append_query_parameter(
        self,
        key: &str,
        value: &str,
    ) -> Result<Uri, Error>;
}

Required Methods§

Source

fn extend_dir_with_path(self, path: &str) -> Result<Uri, Error>

Normalizes empty paths to /, appends / to self’s path if it does not end with one, then appends path, preserving any query parameters. Does nothing if path is the empty string.

Will only error if asked to add a path to a Uri without a scheme (because Uri requires a scheme if a path is present), or if path contains invalid URI characters.

Source

fn append_query_parameter(self, key: &str, value: &str) -> Result<Uri, Error>

Append the given query parameter key=value to the URI, preserving existing query parameters if any, key and value should already be URL-encoded (if necessary).

Will only error if key or value contains invalid URI characters.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl HttpUriExt for Uri

Implementors§