33 lines · 723 B · Rust
RawDownload
use crate::{px, Bounds, DisplayId, Pixels, PlatformDisplay, Point};use anyhow::{Ok, Result}; #[derive(Debug)]pub(crate) struct TestDisplay {    id: DisplayId,    uuid: uuid::Uuid,    bounds: Bounds<Pixels>,} impl TestDisplay {    pub fn new() -> Self {        TestDisplay {            id: DisplayId(1),            uuid: uuid::Uuid::new_v4(),            bounds: Bounds::from_corners(Point::default(), Point::new(px(1920.), px(1080.))),        }    }} impl PlatformDisplay for TestDisplay {    fn id(&self) -> crate::DisplayId {        self.id    }     fn uuid(&self) -> Result<uuid::Uuid> {        Ok(self.uuid)    }     fn bounds(&self) -> crate::Bounds<crate::Pixels> {        self.bounds    }}