pub struct KeySimulator<'a> { /* private fields */ }
Expand description
A fixture that can use different services to send key events. Use KeySimulator::new to create a new instance.
§Example
ⓘ
let ime_service = connect_to_protocol::<ui_input::ImeServiceMarker>()
.context("Failed to connect to IME Service")?;
let key_dispatcher = test_helpers::ImeServiceKeyDispatcher { ime_service: &ime_service };
let key_simulator = test_helpers::KeySimulator::new(&key_dispatcher);
// Thereafter...
key_simulator.dispatch(fidl_fuchsia_ui_input3::KeyEvent{...}).await?;
Implementations§
Auto Trait Implementations§
impl<'a> Freeze for KeySimulator<'a>
impl<'a> !RefUnwindSafe for KeySimulator<'a>
impl<'a> !Send for KeySimulator<'a>
impl<'a> !Sync for KeySimulator<'a>
impl<'a> Unpin for KeySimulator<'a>
impl<'a> !UnwindSafe for KeySimulator<'a>
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