pub struct Getch { /* private fields */ }
Implementations§
Source§impl Getch
impl Getch
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/getch.rs (line 5)
4fn main() {
5 let g = Getch::new();
6
7 println!("press `q` to exit");
8
9 loop {
10 match g.getch() {
11 Ok(Key::Char('q')) => break,
12 Ok(key) => println!("{:?}", key),
13 Err(e) => println!("{}", e),
14 }
15 }
16}
Sourcepub fn getch(&self) -> Result<Key, Error>
pub fn getch(&self) -> Result<Key, Error>
Examples found in repository?
examples/getch.rs (line 10)
4fn main() {
5 let g = Getch::new();
6
7 println!("press `q` to exit");
8
9 loop {
10 match g.getch() {
11 Ok(Key::Char('q')) => break,
12 Ok(key) => println!("{:?}", key),
13 Err(e) => println!("{}", e),
14 }
15 }
16}
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Getch
impl !RefUnwindSafe for Getch
impl Send for Getch
impl !Sync for Getch
impl Unpin for Getch
impl UnwindSafe for Getch
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