maolan-baseview 0.0.4

A low-level windowing system geared towards making audio plugin UIs
use crate::iced::futures;
use crate::iced::graphics;

#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("the futures executor could not be created")]
    ExecutorCreationFailed(futures::io::Error),

    #[error("the application window could not be created")]
    WindowCreationFailed,

    #[error("the application graphics context could not be created")]
    GraphicsCreationFailed(graphics::Error),
}

impl From<graphics::Error> for Error {
    fn from(error: graphics::Error) -> Error {
        Error::GraphicsCreationFailed(error)
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn assert_send_sync() {
        fn _assert<T: Send + Sync>() {}
        _assert::<Error>();
    }
}