pub struct Entry { /* private fields */ }
Expand description
Description of a terminal and its capabilities.
Note that while this type exposes terminal names and user-defined capability names as str
s,
X/Open curses only specifies ISO 8859-1:1987 (“latin-1”) as the encoding, and allows any
graphical character from that character set to be used for names. In practice however, files
only use ASCII, so the parser currently rejects non-ASCII in terminal and capability names.
Implementations§
Source§impl Entry
impl Entry
Sourcepub fn parse(bytes: &[u8]) -> Result<Self, ParseError>
pub fn parse(bytes: &[u8]) -> Result<Self, ParseError>
Parse an Entry
from a byte slice.
Sourcepub fn aliases(&self) -> impl Iterator<Item = &str> + '_
pub fn aliases(&self) -> impl Iterator<Item = &str> + '_
Returns an iterator over the aliases of this terminal.
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Returns the description of this terminal, for example xterm with 256 colors
.
Sourcepub fn get_boolean(&self, n: usize) -> bool
pub fn get_boolean(&self, n: usize) -> bool
Returns the boolean capability with the given index.
Returns false
if the capability is not defined for this terminal.
Sourcepub fn get_integer(&self, n: usize) -> Option<i32>
pub fn get_integer(&self, n: usize) -> Option<i32>
Returns the integer capability with the given index.
Returns None
if the capability is not defined for this terminal.
Sourcepub fn get_string(&self, n: usize) -> Option<&[u8]>
pub fn get_string(&self, n: usize) -> Option<&[u8]>
Returns the string capability with the given index.
Returns None
if the capability is not defined for this terminal.
Sourcepub fn get_user_boolean(&self, name: &str) -> bool
pub fn get_user_boolean(&self, name: &str) -> bool
Returns the user-defined boolean capability with the given name.
Returns false
if the capability is not defined for this terminal.
Sourcepub fn get_user_integer(&self, name: &str) -> Option<i32>
pub fn get_user_integer(&self, name: &str) -> Option<i32>
Returns the user-defined integer capability with the given name.
Returns None
if the capability is not defined for this terminal.
Sourcepub fn get_user_string(&self, name: &str) -> Option<&[u8]>
pub fn get_user_string(&self, name: &str) -> Option<&[u8]>
Returns the user-defined string capability with the given name.
Returns None
if the capability is not defined for this terminal.
Sourcepub fn booleans(&self) -> impl Iterator<Item = bool> + '_
pub fn booleans(&self) -> impl Iterator<Item = bool> + '_
Returns an iterator over all boolean capabilities of this terminal.
Sourcepub fn integers(&self) -> impl Iterator<Item = Option<i32>> + '_
pub fn integers(&self) -> impl Iterator<Item = Option<i32>> + '_
Returns an iterator over all integer capabilities of this terminal.
Sourcepub fn strings(&self) -> impl Iterator<Item = Option<&[u8]>> + '_
pub fn strings(&self) -> impl Iterator<Item = Option<&[u8]>> + '_
Returns an iterator over all string capabilities of this terminal.
Sourcepub fn user_booleans(&self) -> impl Iterator<Item = (&str, bool)> + '_
pub fn user_booleans(&self) -> impl Iterator<Item = (&str, bool)> + '_
Returns an iterator over all user-defined boolean capabilities and their names.