Struct terminfo::Database
[−]
[src]
pub struct Database { /* fields omitted */ }
A capability database.
Methods
impl Database
[src]
fn new(name: String,
aliases: Vec<String>,
description: String,
inner: HashMap<String, Value>)
-> Self
aliases: Vec<String>,
description: String,
inner: HashMap<String, Value>)
-> Self
Create a new database from the given values.
fn from_env() -> Result<Self>
Load a database from the current environment.
fn from_name<N: AsRef<str>>(name: N) -> Result<Self>
Load a database for the given name.
fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
Load a database from the given path.
fn from_buffer<T: AsRef<[u8]>>(buffer: T) -> Result<Self>
Load a database from a buffer.
fn name(&self) -> &str
The terminal name.
fn aliases(&self) -> &[String]
The terminal aliases.
fn description(&self) -> &str
The terminal description.
fn get<'a, C: Capability<'a>>(&'a self) -> Option<C>
Get a capability.
Example
use terminfo::{Database, capability as cap}; let info = Database::from_env().unwrap(); let colors: i16 = info.get::<cap::MaxColors>().unwrap().into();
fn raw<S: AsRef<str>>(&self, name: S) -> Option<&Value>
Get a capability by name.
This interface only makes sense for extended capabilities since they don't have standardized types.
Example
use terminfo::Database; let info = Database::from_env().unwrap(); let truecolor = info.raw("Tc").is_some();
Trait Implementations
impl Eq for Database
[src]
impl PartialEq for Database
[src]
fn eq(&self, __arg_0: &Database) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Database) -> bool
This method tests for !=
.
impl Clone for Database
[src]
fn clone(&self) -> Database
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more