pub enum DisplayServerType {
Wayland,
X11,
Unknown,
}Available on Linux only.
Expand description
Display server type detection
Variants§
Wayland
Wayland display server
X11
X11/Xorg display server
Unknown
Unknown or undetected display server
Implementations§
Source§impl DisplayServerType
impl DisplayServerType
Sourcepub fn detect() -> Self
pub fn detect() -> Self
Detect the current display server type using environment variables.
Checks in order:
XDG_SESSION_TYPE(most reliable)WAYLAND_DISPLAY(indicates Wayland)DISPLAY(indicates X11)
Sourcepub fn prefer_pipewire(&self) -> bool
pub fn prefer_pipewire(&self) -> bool
Returns whether PipeWire should be preferred for this display server.
PipeWire is the modern capture API and works on both X11 and Wayland, but is essential for Wayland and optional for X11.
Trait Implementations§
Source§impl Clone for DisplayServerType
impl Clone for DisplayServerType
Source§fn clone(&self) -> DisplayServerType
fn clone(&self) -> DisplayServerType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DisplayServerType
impl Debug for DisplayServerType
Source§impl PartialEq for DisplayServerType
impl PartialEq for DisplayServerType
impl Copy for DisplayServerType
impl Eq for DisplayServerType
impl StructuralPartialEq for DisplayServerType
Auto Trait Implementations§
impl Freeze for DisplayServerType
impl RefUnwindSafe for DisplayServerType
impl Send for DisplayServerType
impl Sync for DisplayServerType
impl Unpin for DisplayServerType
impl UnwindSafe for DisplayServerType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more