From 8e47f528031dcbef38b3cfb337144dd9ccb78538 Mon Sep 17 00:00:00 2001 From: Christoph Herzog Date: Wed, 30 Oct 2019 01:11:44 +0100 Subject: [PATCH 1/2] Implement std::error::Error for Error --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 5d54905..4bb2781 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -172,6 +172,8 @@ impl Display for Error { } } +impl std::error::Error for Error {} + impl Display for ErrorCode { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { From 9552cad8efe83d3c236042e08fd1acb2b5e8d34d Mon Sep 17 00:00:00 2001 From: Christoph Herzog Date: Wed, 30 Oct 2019 01:13:52 +0100 Subject: [PATCH 2/2] Add method to call custom commands --- src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 4bb2781..9e1bdf2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -502,6 +502,13 @@ impl Mpv { } } + /// Run a custom command. + /// This should only be used if the desired command is not implemented + /// with [MpvCommand]. + pub fn run_command_raw(&self, command: &str, args: &[&str]) -> Result<(), Error> { + run_mpv_command(self, command, args) + } + pub fn playlist_add( &self, file: &str,