pub struct DisplayOwnership { /* private fields */ }
Expand description
A handler that turns the input pipeline off or on based on whether the Scenic owns the display.
This allows us to turn off keyboard processing when the user switches away from the product (e.g. terminal) into virtual console.
See the README.md
file in this crate for details.
Implementations§
Source§impl DisplayOwnership
impl DisplayOwnership
Sourcepub fn new(
display_ownership_event: impl AsHandleRef + 'static,
input_handlers_node: &Node,
) -> Rc<Self>
pub fn new( display_ownership_event: impl AsHandleRef + 'static, input_handlers_node: &Node, ) -> Rc<Self>
Creates a new handler that watches display_ownership_event
for events.
The display_ownership_event
is assumed to be an [Event] obtained from
Scenic using fuchsia.ui.scenic.Scenic/GetDisplayOwnershipEvent
. There
isn’t really a way for this code to know here whether this is true or
not, so implementor beware.
Sourcepub async fn handle_input_events(
self: &Rc<Self>,
input: UnboundedReceiver<InputEvent>,
output: UnboundedSender<InputEvent>,
) -> Result<()>
pub async fn handle_input_events( self: &Rc<Self>, input: UnboundedReceiver<InputEvent>, output: UnboundedSender<InputEvent>, ) -> Result<()>
Run this function in an executor to handle events.
pub fn set_handler_healthy(self: Rc<Self>)
pub fn set_handler_unhealthy(self: Rc<Self>, msg: &str)
Auto Trait Implementations§
impl !Freeze for DisplayOwnership
impl !RefUnwindSafe for DisplayOwnership
impl !Send for DisplayOwnership
impl !Sync for DisplayOwnership
impl Unpin for DisplayOwnership
impl !UnwindSafe for DisplayOwnership
Blanket Implementations§
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
Mutably borrows from an owned value. Read more