zui_core/term/cursor.rs
1//! # Cursor manipulation in the terminal
2//!
3// ## Example
4//
5// ```rust
6// use zui::term::Terminal;
7// use zui::term::cursor::TCursor;
8// use std::io;
9//
10// fn main() {
11// let mut stdout = io::stdout();
12// let mut terminal = Terminal::new(&mut stdout).unwrap();
13// terminal.set_cursor_to(1, 1).unwrap();
14//
15// terminal.show_cursor().unwrap();
16// terminal.hide_cursor().unwrap();
17//
18// terminal.blinking_block().unwrap();
19// terminal.steady_block().unwrap();
20// terminal.blinking_underline().unwrap();
21// terminal.steady_underline().unwrap();
22// terminal.blinking_bar().unwrap();
23// terminal.steady_bar().unwrap();
24// }
25// ```
26//
27// Author: Abhinav Chavali
28// Date: October 8th, 2021
29// Updated: October 13th, 2021
30
31// imports
32use std::io;
33
34/// Cursor states
35#[derive(Debug)]
36pub enum Cursor {
37 Default,
38 Hidden,
39 BlinkingBlock,
40 Block,
41 BlinkingUnderline,
42 Underline,
43 BlinkingBar,
44 Bar,
45}