spice-client 0.2.0

A pure Rust SPICE client library with native and WebAssembly support
use super::{MultimediaBackend, MultimediaError, Result};

pub mod audio;
pub mod display;
pub mod input;

pub struct WasmBackend;

impl WasmBackend {
    pub fn new() -> Result<Self> {
        Ok(Self)
    }
}

impl MultimediaBackend for WasmBackend {
    type Display = display::WasmDisplay;
    type Audio = audio::WasmAudio;
    type Input = input::WasmInput;

    fn create_display(&self) -> Result<Self::Display> {
        display::WasmDisplay::new()
    }

    fn create_audio(&self) -> Result<Self::Audio> {
        audio::WasmAudio::new()
    }

    fn create_input(&self) -> Result<Self::Input> {
        input::WasmInput::new()
    }
}