toodoux 0.4.1

A modern task management tool
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! An abstracton of a terminal.

pub trait Terminal {
  /// Get the dimension (in characters / columns) of the terminal.
  fn dimensions(&self) -> Option<[usize; 2]>;
}

/// Default terminal abstraction..
pub struct DefaultTerm;

impl Terminal for DefaultTerm {
  fn dimensions(&self) -> Option<[usize; 2]> {
    term_size::dimensions().map(|(w, h)| [w, h])
  }
}