Struct Locked

Source
pub struct Locked<'a, B: Buffer> { /* private fields */ }
Expand description

A screen component on which methods can be invoked.

This type combines a screen address, an Invoker that can be used to make method calls, and a scratch buffer used to perform CBOR encoding and decoding. A value of this type can be created by calling Screen::lock, and it can be dropped to return the borrow of the invoker and buffer to the caller so they can be reused for other purposes.

The 'a lifetime is the lifetime of the invoker and the buffer. The B type is the type of scratch buffer to use.

Implementations§

Source§

impl<'a, B: Buffer> Locked<'a, B>

Source

pub async fn is_on(&mut self) -> Result<bool, Error>

Checks whether the screen is powered on or off.

§Errors
Source

pub async fn turn_on(&mut self) -> Result<bool, Error>

Powers on the screen, returning whether the power was previously off.

§Errors
Source

pub async fn turn_off(&mut self) -> Result<bool, Error>

Powers off the screen, returning whether the power was previously on.

§Errors
Source

pub async fn get_aspect_ratio(&mut self) -> Result<Dimension, Error>

Returns the screen’s aspect ratio. The aspect ratio is measured in metres.

§Errors
Source

pub async fn get_keyboards(&mut self) -> Result<Vec<Address>, Error>

Returns the addresses of the keyboards connected to the screen.

§Errors
Source

pub async fn set_precise(&mut self, precise: bool) -> Result<bool, Error>

Sets whether mouse positions are reported at subpixel granularity and returns the old setting.

§Errors
Source

pub async fn is_precise(&mut self) -> Result<bool, Error>

Returns whether mouse positions are reported at subpixel granularity.

§Errors
Source

pub async fn set_touch_mode_inverted( &mut self, inverted: bool, ) -> Result<bool, Error>

Sets whether the touch-screen and open-GUI gestures are inverted from their normal configuration and returns the old setting.

§Errors
Source

pub async fn is_touch_mode_inverted(&mut self) -> Result<bool, Error>

Returns whether the touch-screen and open-GUI gestures are inverted from their normal configuration.

§Errors

Auto Trait Implementations§

§

impl<'a, B> Freeze for Locked<'a, B>

§

impl<'a, B> RefUnwindSafe for Locked<'a, B>
where B: RefUnwindSafe,

§

impl<'a, B> Send for Locked<'a, B>
where B: Send,

§

impl<'a, B> Sync for Locked<'a, B>
where B: Sync,

§

impl<'a, B> Unpin for Locked<'a, B>

§

impl<'a, B> !UnwindSafe for Locked<'a, B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.