feat(global-shortcut): add plugin (#324)

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
This commit is contained in:
Lucas Fernandes Nogueira
2023-04-18 18:18:14 -07:00
committed by GitHub
parent 8cd7d3501b
commit 4b66ba03a5
14 changed files with 857 additions and 2 deletions
+22
View File
@@ -0,0 +1,22 @@
use serde::{Serialize, Serializer};
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("{0}")]
GlobalHotkey(String),
}
impl Serialize for Error {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.serialize_str(self.to_string().as_ref())
}
}
impl From<global_hotkey::Error> for Error {
fn from(value: global_hotkey::Error) -> Self {
Self::GlobalHotkey(value.to_string())
}
}