pub struct Url<'a> { /* private fields */ }
Available on crate feature open
only.
Expand description
Represents an URL to be passed to the open function.
Creates a new URL.
scheme
: the URL scheme.
path
: the URL path.
returns: Url
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.
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"));
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.
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
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
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.