pub fn that(path: impl AsRef<OsStr>) -> Result<()>
Expand description
Open path with the default application without blocking.
§Examples
let path = "http://rust-lang.org";
match open::that(path) {
Ok(()) => println!("Opened '{}' successfully.", path),
Err(err) => panic!("An error occurred when opening '{}': {}", path, err),
}
§Errors
A std::io::Error
is returned on failure. Because different operating systems
handle errors differently it is recommend to not match on a certain error.
§Beware
Sometimes, depending on the platform and system configuration, launchers can block.
If you want to be sure they don’t, use that_in_background()
or that_detached
instead.