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>
impl<'a, B: Buffer> Locked<'a, B>
Sourcepub async fn turn_on(&mut self) -> Result<bool, Error>
pub async fn turn_on(&mut self) -> Result<bool, Error>
Powers on the screen, returning whether the power was previously off.
§Errors
Sourcepub async fn turn_off(&mut self) -> Result<bool, Error>
pub async fn turn_off(&mut self) -> Result<bool, Error>
Powers off the screen, returning whether the power was previously on.
§Errors
Sourcepub async fn get_aspect_ratio(&mut self) -> Result<Dimension, Error>
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
Sourcepub async fn get_keyboards(&mut self) -> Result<Vec<Address>, Error>
pub async fn get_keyboards(&mut self) -> Result<Vec<Address>, Error>
Returns the addresses of the keyboards connected to the screen.
§Errors
Sourcepub async fn set_precise(&mut self, precise: bool) -> Result<bool, Error>
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
BadComponent
TooManyDescriptors
Unsupported
is returned if the screen is not advanced enough to return subpixel-granularity touch data.
Sourcepub async fn is_precise(&mut self) -> Result<bool, Error>
pub async fn is_precise(&mut self) -> Result<bool, Error>
Returns whether mouse positions are reported at subpixel granularity.
§Errors
Sourcepub async fn set_touch_mode_inverted(
&mut self,
inverted: bool,
) -> Result<bool, Error>
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.