uefi_async/nano_alloc/uefi.rs
1use core::pin::Pin;
2use core::task::{Context, Poll};
3use uefi::proto::console::text::{Input, Key};
4
5pub struct KeyInputFuture<'a> {
6 text_input: &'a mut Input,
7}
8
9impl<'a> Future for KeyInputFuture<'a> {
10 type Output = Key;
11
12 fn poll(mut self: Pin<&mut Self>, _: &mut Context) -> Poll<Self::Output> {
13 match self.text_input.read_key() {
14 Ok(Some(key)) => Poll::Ready(key),
15 _ => Poll::Pending,
16 }
17 }
18}