termint 0.8.1

Library for colored printing and Terminal User Interfaces
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// Text token used by the `TextParser`
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum TextToken {
    // Text token containing the text and its length
    Text { text: String, len: usize },
    // Newline token
    Newline,
    // End of the text token
    End,
}

impl TextToken {
    /// Creates new text token
    pub fn text(text: String, len: usize) -> Self {
        Self::Text { text, len }
    }
}