wayland: implement ext-foreign-toplevel-list-v1
This commit is contained in:
parent
ccacdda03e
commit
3f7b1ddd49
15 changed files with 434 additions and 8 deletions
28
src/utils/toplevel_identifier.rs
Normal file
28
src/utils/toplevel_identifier.rs
Normal 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()?))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue