tauri-plugin-quicklook 0.1.0

A Tauri plugin providing APIs to display and manage the macOS QuickLookUI Preview Pane.
use serde::{ser::Serializer, Serialize};

pub type Result<T> = std::result::Result<T, Error>;

#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("NSURL could not be initialized: Malformed URL")]
    NSURLMalformedURLString,
    #[error("Failed to dispatch execution to main thread")]
    MainThreadDispatchFailed,
}

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())
    }
}