1
0
Fork 0
forked from wry/wry

wayland: implement xdg-activation

This commit is contained in:
Julian Orth 2024-02-14 17:42:59 +01:00
parent 0628a9d393
commit 41d7531cd5
26 changed files with 667 additions and 50 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 ActivationToken(Opaque);
pub fn activation_token() -> ActivationToken {
ActivationToken(opaque())
}
impl Display for ActivationToken {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
impl FromStr for ActivationToken {
type Err = OpaqueError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self(s.parse()?))
}
}