diff --git a/src/control/connector.rs b/src/control/connector.rs index 9fc4755..1eaae00 100644 --- a/src/control/connector.rs +++ b/src/control/connector.rs @@ -60,6 +60,12 @@ pub struct Info { pub(crate) subpixel: SubPixel, } +impl std::fmt::Display for Info { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}-{}", self.interface.as_str(), self.interface_id) + } +} + impl Info { /// Returns the handle to this connector. pub fn handle(&self) -> Handle { diff --git a/src/control/crtc.rs b/src/control/crtc.rs index 0827043..cfaf9b3 100644 --- a/src/control/crtc.rs +++ b/src/control/crtc.rs @@ -62,6 +62,12 @@ pub struct Info { pub(crate) gamma_length: u32, } +impl std::fmt::Display for Info { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "CRTC {}", self.handle.0) + } +} + impl Info { /// Returns the handle to this CRTC. pub fn handle(&self) -> Handle { diff --git a/src/control/encoder.rs b/src/control/encoder.rs index fd194b1..e5def40 100644 --- a/src/control/encoder.rs +++ b/src/control/encoder.rs @@ -53,6 +53,12 @@ pub struct Info { pub(crate) pos_clones: u32, } +impl std::fmt::Display for Info { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Encoder {}", self.handle.0) + } +} + impl Info { /// Returns the handle to this encoder. pub fn handle(&self) -> Handle { diff --git a/src/control/framebuffer.rs b/src/control/framebuffer.rs index 1e80ceb..91517fb 100644 --- a/src/control/framebuffer.rs +++ b/src/control/framebuffer.rs @@ -55,6 +55,12 @@ pub struct Info { pub(crate) buffer: Option, } +impl std::fmt::Display for Info { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Framebuffer {}", self.handle.0) + } +} + impl Info { /// Returns the handle to this framebuffer. pub fn handle(&self) -> Handle { diff --git a/src/control/plane.rs b/src/control/plane.rs index c287935..3637d94 100644 --- a/src/control/plane.rs +++ b/src/control/plane.rs @@ -65,6 +65,12 @@ pub struct Info { pub(crate) formats: Vec, } +impl std::fmt::Display for Info { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Plane {}", self.handle.0) + } +} + impl Info { /// Returns the handle to this plane. pub fn handle(&self) -> Handle {