Struct evdi::handle::Handle [−][src]
pub struct Handle { pub events: HandleEvents, // some fields omitted }
Represents an evdi handle that is connected and ready.
Fields
events: HandleEvents
Holds ::tokio::sync::mpsc::Receiver
s for events.
// Initially events will be None let mode = handle.events.current_mode(); assert!(mode.is_none()); // Wait for a mode let mode: Mode = handle.events.await_mode(timeout).await?;
Implementations
impl Handle
[src]
impl Handle
[src]pub fn new_buffer(&mut self, mode: &Mode) -> BufferId
[src]
pub fn new_buffer(&mut self, mode: &Mode) -> BufferId
[src]Allocate and register a buffer to store the screen of a device with a specific mode.
You are responsible for re-creating buffers if the mode changes.
pub fn unregister_buffer(&mut self, id: BufferId)
[src]
pub fn unregister_buffer(&mut self, id: BufferId)
[src]De-allocate and unregister a buffer.
pub fn get_buffer(&self, id: BufferId) -> Option<&Buffer>
[src]
pub fn get_buffer(&self, id: BufferId) -> Option<&Buffer>
[src]Get buffer data if the BufferId
provided is associated with this handle.
pub async fn request_update(
&mut self,
buffer_id: BufferId,
timeout: Duration
) -> Result<(), RequestUpdateError>
[src]
pub async fn request_update(
&mut self,
buffer_id: BufferId,
timeout: Duration
) -> Result<(), RequestUpdateError>
[src]Ask the kernel module to update a buffer with the current display pixels.
Blocks until the update is complete.
let buf_id = handle.new_buffer(&mode); handle.request_update(buf_id, timeout).await?; let buf_data = handle.get_buffer(buf_id).expect("Buffer exists");
Note: Handle::request_update
happens to be implemented in such a way that it causes
events available at the time it is called to be dispatched. Users should not rely on this.
pub fn enable_cursor_events(&self, enable: bool)
[src]
pub fn disconnect(self) -> UnconnectedHandle
[src]
pub fn disconnect(self) -> UnconnectedHandle
[src]Disconnect the handle.
A handle is automatically disconnected and closed on drop, you only need this if you want
to keep the UnconnectedHandle
around to potentially connect to later.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Handle
impl !Send for Handle
impl !Sync for Handle
impl Unpin for Handle
impl !UnwindSafe for Handle
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,