Struct termwiz::caps::Capabilities
source · [−]pub struct Capabilities { /* private fields */ }
Expand description
Capabilities
holds information about the capabilities of a terminal.
On POSIX systems this is largely derived from an available terminfo
database, but there are some newish capabilities that are not yet
described by the majority of terminfo installations and thus have some
additional handling in this struct.
Implementations
sourceimpl Capabilities
impl Capabilities
sourcepub fn new_from_env() -> Result<Self>
pub fn new_from_env() -> Result<Self>
Detect the capabilities of the terminal and return the Capability object holding the outcome. This function inspects the environment variables to build up configuration hints.
sourcepub fn new_with_hints(hints: ProbeHints) -> Result<Self>
pub fn new_with_hints(hints: ProbeHints) -> Result<Self>
Build a Capabilities
object based on the provided ProbeHints
object.
sourcepub fn color_level(&self) -> ColorLevel
pub fn color_level(&self) -> ColorLevel
Indicates how many colors are supported
sourcepub fn hyperlinks(&self) -> bool
pub fn hyperlinks(&self) -> bool
Does the terminal support hyperlinks? See https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
sourcepub fn iterm2_image(&self) -> bool
pub fn iterm2_image(&self) -> bool
Does the terminal support the iTerm2 image protocol? See https://www.iterm2.com/documentation-images.html
sourcepub fn bce(&self) -> bool
pub fn bce(&self) -> bool
Is bce
, background color erase supported?
http://invisible-island.net/ncurses/ncurses-slang.html#env_COLORTERM_BCE
sourcepub fn terminfo_db(&self) -> Option<&Database>
pub fn terminfo_db(&self) -> Option<&Database>
Returns a reference to the loaded terminfo, if any.
sourcepub fn bracketed_paste(&self) -> bool
pub fn bracketed_paste(&self) -> bool
Whether bracketed paste is supported
sourcepub fn mouse_reporting(&self) -> bool
pub fn mouse_reporting(&self) -> bool
Whether mouse reporting is supported
Trait Implementations
sourceimpl Clone for Capabilities
impl Clone for Capabilities
sourcefn clone(&self) -> Capabilities
fn clone(&self) -> Capabilities
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
Auto Trait Implementations
impl RefUnwindSafe for Capabilities
impl Send for Capabilities
impl Sync for Capabilities
impl Unpin for Capabilities
impl UnwindSafe for Capabilities
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