glycin-utils 5.0.0-alpha

Sandboxed image decoding
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! D-Bus API for external processors

mod editor;
mod loader;

use std::panic::UnwindSafe;

pub use editor::*;
pub use loader::*;

use crate::RemoteError;

fn catch_unwind<R, F: FnOnce() -> R + UnwindSafe>(f: F) -> Result<R, RemoteError> {
    std::panic::catch_unwind(f).map_err(|_| RemoteError::Panic)
}