Struct nixterm::term::TermWriter [−][src]
Methods
impl<'a, O> TermWriter<'a, O> where
O: Write + AsRawFd + 'a,
[src]
impl<'a, O> TermWriter<'a, O> where
O: Write + AsRawFd + 'a,
pub fn write_bytes(self, buf: &[u8]) -> Self
[src]
pub fn write_bytes(self, buf: &[u8]) -> Self
pub fn print<T: AsRef<str>>(self, s: T) -> Self
[src]
pub fn print<T: AsRef<str>>(self, s: T) -> Self
pub fn println<T: AsRef<str>>(self, s: T) -> Self
[src]
pub fn println<T: AsRef<str>>(self, s: T) -> Self
pub fn bold(self) -> Self
[src]
pub fn bold(self) -> Self
pub fn blink(self) -> Self
[src]
pub fn blink(self) -> Self
pub fn italics(self) -> Self
[src]
pub fn italics(self) -> Self
pub fn underline(self) -> Self
[src]
pub fn underline(self) -> Self
pub fn invisible(self) -> Self
[src]
pub fn invisible(self) -> Self
pub fn standout(self) -> Self
[src]
pub fn standout(self) -> Self
pub fn dim(self) -> Self
[src]
pub fn dim(self) -> Self
pub fn clear(self) -> Self
[src]
pub fn clear(self) -> Self
pub fn done(self) -> Result<usize>
[src]
pub fn done(self) -> Result<usize>
pub fn err(&self) -> &Option<Error>
[src]
pub fn err(&self) -> &Option<Error>
pub fn written(&self) -> usize
[src]
pub fn written(&self) -> usize
pub fn foreground<T: Into<Color>>(self, color: T) -> Self
[src]
pub fn foreground<T: Into<Color>>(self, color: T) -> Self
Set the terminal's foreground color.
T
a ansi::Color
enum, a number (u8
) or a string.
strings may name a color, or provide custom r, g, and b values.
Any of the following are valid:
- "black"
- "red"
- "green"
- "yellow"
- "blue"
- "magenta"
- "cyan"
- "grey"
- "white" (same as "bright grey")
- "bright*" (
*
may be any of the other named colors) - "#rrggbb"
- "#rgb"
- "rgb(r, g, b)"
Numbers are also valid, the number must fit inside a u8
(so it should be in the range 0-255).
Compatibility
Everything layed out above will work as far as this library, but the chances of it actually being supported across any meaningful number of terminals is closed to 0.
24-bit Colors
Full RGB (that is, 24-bit color) terminals are pretty rare. When full 24-bit colors are not supported, the color will get as close as it can with whatever the terminal provides.
8-bit Colors
256 color terminals are fairly common, using depending on indices beyond 15 is still risky though.
4/3-bit Colors
Basically all terminals will support 3-bits, many will support 4 (that 4th bit gives the option of a "bright" variant).
pub fn background<T: Into<Color>>(self, color: T) -> Self
[src]
pub fn background<T: Into<Color>>(self, color: T) -> Self
pub fn default_background(self) -> Self
[src]
pub fn default_background(self) -> Self
pub fn default_foreground(self) -> Self
[src]
pub fn default_foreground(self) -> Self
Trait Implementations
impl<'a, O> Write for TermWriter<'a, O> where
O: Write + AsRawFd,
[src]
impl<'a, O> Write for TermWriter<'a, O> where
O: Write + AsRawFd,
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this object, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<()>
[src]
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this write. Read more
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
Writes a formatted string into this writer, returning any error encountered. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
Creates a "by reference" adaptor for this instance of Write
. Read more
Auto Trait Implementations
impl<'a, O> !Send for TermWriter<'a, O>
impl<'a, O> !Send for TermWriter<'a, O>
impl<'a, O> Sync for TermWriter<'a, O> where
O: Sync,
impl<'a, O> Sync for TermWriter<'a, O> where
O: Sync,