[][src]Struct terminfo::Database

pub struct Database { /* fields omitted */ }

A capability database.

Implementations

impl Database[src]

pub fn new() -> Builder[src]

Create a new empty database.

pub fn from_env() -> Result<Self>[src]

Load a database from the current environment.

pub fn from_name<N: AsRef<str>>(name: N) -> Result<Self>[src]

Load a database for the given name.

pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Load a database from the given path.

pub fn from_buffer<T: AsRef<[u8]>>(buffer: T) -> Result<Self>[src]

Load a database from a buffer.

pub fn name(&self) -> &str[src]

The terminal name.

pub fn aliases(&self) -> &[String][src]

The terminal aliases.

pub fn description(&self) -> &str[src]

The terminal description.

pub fn get<'a, C: Capability<'a>>(&'a self) -> Option<C>[src]

Get a capability.

Example

use terminfo::{Database, capability as cap};

let info        = Database::from_env().unwrap();
let colors: i32 = info.get::<cap::MaxColors>().unwrap().into();

pub fn raw<S: AsRef<str>>(&self, name: S) -> Option<&Value>[src]

Get a capability by name.

Note

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 Clone for Database[src]

impl Debug for Database[src]

impl Eq for Database[src]

impl<'a> Into<Database> for Database<'a>[src]

impl PartialEq<Database> for Database[src]

impl StructuralEq for Database[src]

impl StructuralPartialEq for Database[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.