Struct TerminfoTerminal

Source
pub(crate) struct TerminfoTerminal<T> {
    num_colors: u32,
    out: T,
    ti: TermInfo,
}
๐Ÿ”ฌThis is a nightly-only experimental API. (test)
Expand description

A Terminal that knows how many colors it supports, with a reference to its parsed Terminfo database record.

Fieldsยง

ยงnum_colors: u32
๐Ÿ”ฌThis is a nightly-only experimental API. (test)
ยงout: T
๐Ÿ”ฌThis is a nightly-only experimental API. (test)
ยงti: TermInfo
๐Ÿ”ฌThis is a nightly-only experimental API. (test)

Implementationsยง

Sourceยง

impl<T: Write + Send> TerminfoTerminal<T>

Source

pub(crate) fn new_with_terminfo( out: T, terminfo: TermInfo, ) -> TerminfoTerminal<T> โ“˜

๐Ÿ”ฌThis is a nightly-only experimental API. (test)

Creates a new TerminfoTerminal with the given TermInfo and Write.

Source

pub(crate) fn new(out: T) -> Option<TerminfoTerminal<T>>

๐Ÿ”ฌThis is a nightly-only experimental API. (test)

Creates a new TerminfoTerminal for the current environment with the given Write.

Returns None when the terminfo cannot be found or parsed.

Source

fn dim_if_necessary(&self, color: u32) -> u32

๐Ÿ”ฌThis is a nightly-only experimental API. (test)
Source

fn apply_cap(&mut self, cmd: &str, params: &[Param]) -> Result<bool>

๐Ÿ”ฌThis is a nightly-only experimental API. (test)

Trait Implementationsยง

Sourceยง

impl<T: Write + Send> Terminal for TerminfoTerminal<T>

Sourceยง

fn fg(&mut self, color: u32) -> Result<bool>

๐Ÿ”ฌThis is a nightly-only experimental API. (test)
Sets the foreground color to the given color. Read more
Sourceยง

fn reset(&mut self) -> Result<bool>

๐Ÿ”ฌThis is a nightly-only experimental API. (test)
Resets all terminal attributes and colors to their defaults. Read more
Sourceยง

impl<T: Write> Write for TerminfoTerminal<T>

Sourceยง

fn write(&mut self, buf: &[u8]) -> Result<usize>

Writes a buffer into this writer, returning how many bytes were written. Read more
Sourceยง

fn flush(&mut self) -> Result<()>

Flushes this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
1.36.0 ยท Sourceยง

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
Sourceยง

fn is_write_vectored(&self) -> bool

๐Ÿ”ฌThis is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored implementation. Read more
1.0.0 ยท Sourceยง

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
Sourceยง

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

๐Ÿ”ฌThis is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 ยท Sourceยง

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error encountered. Read more
1.0.0 ยท Sourceยง

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Creates a โ€œby referenceโ€ adapter for this instance of Write. Read more

Auto Trait Implementationsยง

ยง

impl<T> Freeze for TerminfoTerminal<T>
where T: Freeze,

ยง

impl<T> RefUnwindSafe for TerminfoTerminal<T>
where T: RefUnwindSafe,

ยง

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

ยง

impl<T> Sync for TerminfoTerminal<T>
where T: Sync,

ยง

impl<T> Unpin for TerminfoTerminal<T>
where T: Unpin,

ยง

impl<T> UnwindSafe for TerminfoTerminal<T>
where T: UnwindSafe,

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> 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> SizedTypeProperties for T

Sourceยง

#[doc(hidden)] const IS_ZST: bool = _

๐Ÿ”ฌThis is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
Sourceยง

#[doc(hidden)] const LAYOUT: Layout = _

๐Ÿ”ฌThis is a nightly-only experimental API. (sized_type_properties)
Sourceยง

#[doc(hidden)] const MAX_SLICE_LEN: usize = _

๐Ÿ”ฌThis is a nightly-only experimental API. (sized_type_properties)
The largest safe length for a [Self]. 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.