robius-open
This crate provides easy Rust interfaces to open URIs across multiple platforms, including:
- macOS (via
NSWorkspace) - Android (via
android/content/Intent) - Linux (via
xdg-open) - Windows (via
start) - iOS (via
UIApplication)
URIs take many different forms: URLs (http://), tel:, mailto:, file://, and more (see the official list of schemes).
Examples
use Uri;
new
.open
.expect;
use Uri;
new
.open
.expect;
Android usage
To use this crate on Android, you must add the following to your app manifest:
or alternatively, disable the android-result feature.
However, disabling this feature will make Uri::open() always return Ok, regardless of whether the URI was successfully opened.