wayland_backend/types/
server.rsuse crate::protocol::Interface;
#[derive(Debug)]
pub struct GlobalInfo {
pub interface: &'static Interface,
pub version: u32,
pub disabled: bool,
}
#[derive(Debug)]
pub enum InitError {
NoWaylandLib,
Io(std::io::Error),
}
impl std::error::Error for InitError {
#[cfg_attr(coverage, coverage(off))]
fn cause(&self) -> Option<&dyn std::error::Error> {
match self {
InitError::Io(ref err) => Some(err),
InitError::NoWaylandLib => None,
}
}
}
impl std::fmt::Display for InitError {
#[cfg_attr(coverage, coverage(off))]
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
match self {
InitError::Io(ref err) => std::fmt::Display::fmt(err, f),
InitError::NoWaylandLib => f.write_str("could not load libwayland-server.so"),
}
}
}
#[derive(Clone, Debug)]
pub struct InvalidId;
impl std::error::Error for InvalidId {}
impl std::fmt::Display for InvalidId {
#[cfg_attr(coverage, coverage(off))]
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> Result<(), ::std::fmt::Error> {
write!(f, "Invalid Id")
}
}
#[derive(Debug)]
pub enum DisconnectReason {
ConnectionClosed,
ProtocolError(crate::protocol::ProtocolError),
}
#[derive(Debug, Clone, Copy)]
pub struct Credentials {
pub pid: rustix::process::RawPid,
pub uid: rustix::process::RawUid,
pub gid: rustix::process::RawGid,
}