pub struct XDisplay { /* private fields */ }Expand description
๐ โฌก ๐ A connection to an X11 display server.
๐ฆ size_of::<XDisplay>() == 240 bytes / 1920 bits #๏ธโฃ #[cfg(target_pointer_width = โ64โ)]
โ๏ธOption<T>
Wraps an xcb_connection_t and its associated screen information.
Represents the root environment required to create windows and interact with the X server.
Implementationsยง
Sourceยงimpl XDisplay
impl XDisplay
Sourcepub fn open() -> Result<Self, XError> โ
pub fn open() -> Result<Self, XError> โ
Opens the default X11 display and retrieves its first screen.
Sourcepub const fn bits_per_pixel(&self) -> u8
pub const fn bits_per_pixel(&self) -> u8
Sourcepub const fn scanline_pad_bits(&self) -> u8
pub const fn scanline_pad_bits(&self) -> u8
Sourcepub const fn bytes_per_line(&self, width: u16) -> u32
pub const fn bytes_per_line(&self, width: u16) -> u32
Sourcepub fn poll_event(&mut self) -> Event
pub fn poll_event(&mut self) -> Event
Polls the next event without blocking.
If a raw event is available, it is processed through handle_raw_event
and returned as a high-level Event.
If no event is pending, returns Event::None.
This is suitable for rendering loops or cooperative schedulers where the program must remain responsive without waiting.
Sourcepub fn wait_event(&mut self) -> Event
pub fn wait_event(&mut self) -> Event
Waits for the next event, blocking until one is available.
The raw event is passed to handle_raw_event and returned as a high-level Event.
If the X connection enters an error state, returns Event::None.
This is the blocking counterpart of poll_event, used when the
application should sleep until user input or a window notification arrives.
Trait Implementationsยง
Auto Trait Implementationsยง
impl !Send for XDisplay
impl !Sync for XDisplay
impl Freeze for XDisplay
impl RefUnwindSafe for XDisplay
impl Unpin for XDisplay
impl UnsafeUnpin for XDisplay
impl UnwindSafe for XDisplay
Blanket Implementationsยง
Sourceยงimpl<T> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.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
Sourceยงimpl<T> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice only.