Enum pyembed::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
sourceimpl Clone for TerminfoResolution
impl Clone for TerminfoResolution
sourcefn clone(&self) -> TerminfoResolution
fn clone(&self) -> TerminfoResolution
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TerminfoResolution
impl Debug for TerminfoResolution
sourceimpl PartialEq<TerminfoResolution> for TerminfoResolution
impl PartialEq<TerminfoResolution> for TerminfoResolution
sourcefn eq(&self, other: &TerminfoResolution) -> bool
fn eq(&self, other: &TerminfoResolution) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &TerminfoResolution) -> bool
fn ne(&self, other: &TerminfoResolution) -> bool
This method tests for !=
.
sourceimpl ToString for TerminfoResolution
impl ToString for TerminfoResolution
sourceimpl<'_> TryFrom<&'_ str> for TerminfoResolution
impl<'_> TryFrom<&'_ str> for TerminfoResolution
sourceimpl TryFrom<String> for TerminfoResolution
impl TryFrom<String> for TerminfoResolution
impl StructuralPartialEq for TerminfoResolution
Auto Trait Implementations
impl RefUnwindSafe for TerminfoResolution
impl Send for TerminfoResolution
impl Sync for TerminfoResolution
impl Unpin for TerminfoResolution
impl UnwindSafe for TerminfoResolution
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more