Struct bp3d_os::open::Url

source ·
pub struct Url<'a> { /* private fields */ }
Available on crate feature open only.
Expand description

Represents an URL to be passed to the open function.

Implementations§

Creates a new URL.

Arguments
  • scheme: the URL scheme.
  • path: the URL path.

returns: Url

Examples
use std::ffi::OsStr;
use bp3d_os::open::Url;
let url = Url::new("https", OsStr::new("rust-lang.org"));
assert_eq!(url.scheme(), "https");
assert_eq!(url.path(), OsStr::new("rust-lang.org"));

Returns the scheme of this URL.

Returns the path of this URL.

Returns true if this URL is a path to a file or a folder on the local system.

Converts this URL to an URL string wich can be parsed by most platforms.

Examples
use std::ffi::OsStr;
use bp3d_os::open::Url;
let url = Url::new("https", OsStr::new("rust-lang.org"));
assert_eq!(&url.to_os_str().unwrap(), OsStr::new("https://rust-lang.org"));

Trait Implementations§

Formats the value using the given formatter. Read more
Converts to this type from the input type.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more