pub struct KeyboardListenerSynchronousProxy { /* private fields */ }
Implementations§
Source§impl KeyboardListenerSynchronousProxy
impl KeyboardListenerSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<KeyboardListenerEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<KeyboardListenerEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn on_key_event(
&self,
event: &KeyEvent,
___deadline: MonotonicInstant,
) -> Result<KeyEventStatus, Error>
pub fn on_key_event( &self, event: &KeyEvent, ___deadline: MonotonicInstant, ) -> Result<KeyEventStatus, Error>
Called when a key event takes place, such as key press or release.
Protocol implementers must respond to acknowledge the event by returning Status in a timely manner, i.e. not introducing significant delays to the input pipeline (typically 10s of milliseconds).
Returning NOT_HANDLED
means the event may be offered to other
clients of other related APIs.
Clients that do not acknowledge their events will eventually be disconnected.
Notification is only dispatched to a view that has focus. No other views,
including parents or children, will get notified specifically via OnKeyEvent
.
Trait Implementations§
Source§impl SynchronousProxy for KeyboardListenerSynchronousProxy
impl SynchronousProxy for KeyboardListenerSynchronousProxy
Source§type Proxy = KeyboardListenerProxy
type Proxy = KeyboardListenerProxy
The async proxy for the same protocol.
Source§type Protocol = KeyboardListenerMarker
type Protocol = KeyboardListenerMarker
The protocol which this
Proxy
controls.Source§fn from_channel(inner: Channel) -> Self
fn from_channel(inner: Channel) -> Self
Create a proxy over the given channel.
Source§fn into_channel(self) -> Channel
fn into_channel(self) -> Channel
Convert the proxy back into a channel.
Source§fn as_channel(&self) -> &Channel
fn as_channel(&self) -> &Channel
Get a reference to the proxy’s underlying channel. Read more
Auto Trait Implementations§
impl Freeze for KeyboardListenerSynchronousProxy
impl RefUnwindSafe for KeyboardListenerSynchronousProxy
impl Send for KeyboardListenerSynchronousProxy
impl Sync for KeyboardListenerSynchronousProxy
impl Unpin for KeyboardListenerSynchronousProxy
impl UnwindSafe for KeyboardListenerSynchronousProxy
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