UrlExt

Trait UrlExt 

Source
pub trait UrlExt {
    // Required methods
    fn to_local_path(&self) -> Result<Option<PathBuf>>;
    fn display(&self) -> impl Display;
}
Expand description

Extension trait for Url.

Required Methods§

Source

fn to_local_path(&self) -> Result<Option<PathBuf>>

Converts the URL to a local path if it uses the file scheme.

Returns Ok(None) if the URL is not a file scheme.

Returns an error if the URL uses a file scheme but cannot be represented as a local path.

Source

fn display(&self) -> impl Display

Displays a URL without its query parameters.

This is used to prevent authentication information from being displayed to users.

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.

Implementations on Foreign Types§

Source§

impl UrlExt for Url

Implementors§