imdl 0.1.14

📦 A 40' shipping container for the internet
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::common::*;

pub(crate) trait PlatformInterface {
  fn open_file(path: &Path) -> Result<(), Error> {
    Self::open_target(path.as_ref())
  }

  fn open_url(url: &Url) -> Result<(), Error> {
    Self::open_target(url.as_str().as_ref())
  }

  fn open_target(target: &OsStr) -> Result<(), Error> {
    open::that(target).context(error::OpenerInvoke)
  }
}