pub struct TerminalWriter<'a> { /* private fields */ }Expand description
Writable (implements Write) object for TerminalSurface
Implementations§
Source§impl<'a> TerminalWriter<'a>
impl<'a> TerminalWriter<'a>
pub fn new<S>(ctx: ViewContext, surf: &'a mut S) -> Self
Sourcepub fn set_cursor(&mut self, pos: Position) -> &mut Self
pub fn set_cursor(&mut self, pos: Position) -> &mut Self
Move cursor to specified position
Trait Implementations§
Source§impl CellWrite for TerminalWriter<'_>
impl CellWrite for TerminalWriter<'_>
Source§fn with_wraps(self, wraps: bool) -> Selfwhere
Self: Sized,
fn with_wraps(self, wraps: bool) -> Selfwhere
Self: Sized,
Return self with updated wraps flag
Source§fn scope(&mut self, scope: impl FnOnce(&mut Self)) -> &mut Self
fn scope(&mut self, scope: impl FnOnce(&mut Self)) -> &mut Self
Create scope that reverts face and wraps flags on exit
fn with_cell(self, cell: Cell) -> Selfwhere
Self: Sized,
fn with_char(self, character: char) -> Selfwhere
Self: Sized,
fn with_glyph(self, glyph: Glyph) -> Selfwhere
Self: Sized,
fn with_image(self, image: Image) -> Selfwhere
Self: Sized,
Source§fn put_fmt<T>(&mut self, value: &T, face: Option<Face>) -> &mut Self
fn put_fmt<T>(&mut self, value: &T, face: Option<Face>) -> &mut Self
Put anything that is format-able (Note: that std::format_args is also std::fmt::Display)
fn with_fmt<T>(self, value: &T, face: Option<Face>) -> Self
fn with_text(self, text: &Text) -> Selfwhere
Self: Sized,
Source§fn utf8_writer(self) -> Utf8CellWriter<Self> ⓘwhere
Self: Sized,
fn utf8_writer(self) -> Utf8CellWriter<Self> ⓘwhere
Self: Sized,
Returns std::io::Write that can decode UTF8 characters Read more
Source§fn tty_writer(self) -> TTYCellWriter<Self> ⓘwhere
Self: Sized,
fn tty_writer(self) -> TTYCellWriter<Self> ⓘwhere
Self: Sized,
Returns std::io::Write that can decode TTY escape sequences Read more
Source§impl Write for TerminalWriter<'_>
impl Write for TerminalWriter<'_>
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
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<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
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>
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
Auto Trait Implementations§
impl<'a> Freeze for TerminalWriter<'a>
impl<'a> !RefUnwindSafe for TerminalWriter<'a>
impl<'a> Send for TerminalWriter<'a>
impl<'a> Sync for TerminalWriter<'a>
impl<'a> Unpin for TerminalWriter<'a>
impl<'a> !UnwindSafe for TerminalWriter<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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