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::Receivers 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]

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]

De-allocate and unregister a buffer.

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]

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]

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

impl Debug for Handle[src]

fn fmt(&self, __f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Drop for Handle[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl PartialEq<Handle> for Handle[src]

fn eq(&self, other: &Self) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Eq for Handle[src]

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> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[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]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V