1
0
Fork 0
forked from wry/wry

wayland: implement ext-foreign-toplevel-list-v1

This commit is contained in:
Julian Orth 2024-02-14 21:13:32 +01:00
parent ccacdda03e
commit 3f7b1ddd49
15 changed files with 434 additions and 8 deletions

View file

@ -0,0 +1,28 @@
use {
crate::utils::opaque::{opaque, Opaque, OpaqueError},
std::{
fmt::{Display, Formatter},
str::FromStr,
},
};
#[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)]
pub struct ToplevelIdentifier(Opaque);
pub fn toplevel_identifier() -> ToplevelIdentifier {
ToplevelIdentifier(opaque())
}
impl Display for ToplevelIdentifier {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
impl FromStr for ToplevelIdentifier {
type Err = OpaqueError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self(s.parse()?))
}
}