Enum TerminfoResolution

Source
pub enum TerminfoResolution {
    Dynamic,
    None,
    Static(String),
}
Expand description

Defines terminfo database resolution semantics.

Python links against libraries like readline, libedit, and ncurses which need to utilize a terminfo database (a set of files defining terminals and their capabilities) in order to work properly.

The absolute path to the terminfo database is typically compiled into these libraries at build time. If the compiled path on the building machine doesn’t match the path on the runtime machine, these libraries cannot find the terminfo database and terminal interactions won’t work correctly because these libraries don’t know how to resolve terminal features. This can result in quirks like the backspace key not working in prompts.

The pyembed Rust crate is able to point libraries at a terminfo database at runtime, overriding the compiled-in default path. This enum is used to control that behavior.

Serialization type: string.

Variants§

§

Dynamic

Resolve terminfo database using appropriate behavior for current OS.

We will look for the terminfo database in paths that are common for the current OS / distribution. The terminfo database is present in most systems (except the most barebones containers or sandboxes) and this method is usually successfully in locating the terminfo database.

Serialized value: dynamic

§

None

Do not attempt to resolve the terminfo database. Basically a no-op.

This is what should be used for applications that don’t interact with the terminal. Using this option will prevent some I/O syscalls that would be incurred by dynamic.

Serialized value: none

§

Static(String)

Use a specified string as the TERMINFO_DIRS value.

Serialized value: static:<path>

e.g. static:/usr/share/terminfo.

Trait Implementations§

Source§

impl Clone for TerminfoResolution

Source§

fn clone(&self) -> TerminfoResolution

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TerminfoResolution

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TerminfoResolution

Source§

fn eq(&self, other: &TerminfoResolution) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToString for TerminfoResolution

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl TryFrom<&str> for TerminfoResolution

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_from( value: &str, ) -> Result<TerminfoResolution, <TerminfoResolution as TryFrom<&str>>::Error>

Performs the conversion.
Source§

impl TryFrom<String> for TerminfoResolution

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_from( value: String, ) -> Result<TerminfoResolution, <TerminfoResolution as TryFrom<String>>::Error>

Performs the conversion.
Source§

impl Eq for TerminfoResolution

Source§

impl StructuralPartialEq for TerminfoResolution

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,