pub struct AnsiWriter<W> { /* private fields */ }Expand description
A backend that writes Urushi commands as ANSI, CSI, OSC, and C0 bytes.
This type owns only the output half of a terminal connection. Input parsing, process-side raw mode, and platform queries are deliberately separate: an interactive backend composes them around the same physical endpoint.
Implementations§
Source§impl<W> AnsiWriter<W>
impl<W> AnsiWriter<W>
pub const fn new(writer: W) -> Self
pub const fn writer(&self) -> &W
pub fn writer_mut(&mut self) -> &mut W
pub fn into_inner(self) -> W
Source§impl<W: Write> AnsiWriter<W>
impl<W: Write> AnsiWriter<W>
Sourcepub fn write_style_prefix(&mut self, style: TerminalStyle) -> Result<()>
pub fn write_style_prefix(&mut self, style: TerminalStyle) -> Result<()>
Writes the SGR sequence that enables style, if it has any active part.
Unlike Command::SetStyle, this does not reset prior terminal state.
It is intended for a caller that owns a self-contained style scope and
closes it with Self::write_style_reset.
Sourcepub fn write_style_reset(&mut self) -> Result<()>
pub fn write_style_reset(&mut self) -> Result<()>
Writes the SGR sequence that restores the default style.
Sourcepub fn write_hyperlink_start(
&mut self,
link: TerminalHyperlink<'_>,
) -> Result<()>
pub fn write_hyperlink_start( &mut self, link: TerminalHyperlink<'_>, ) -> Result<()>
Writes an OSC 8 sequence that starts link.
Sourcepub fn write_hyperlink_end(&mut self) -> Result<()>
pub fn write_hyperlink_end(&mut self) -> Result<()>
Writes the OSC 8 sequence that closes the active hyperlink.
Trait Implementations§
Source§impl<W: Write> CommandWriter for AnsiWriter<W>
impl<W: Write> CommandWriter for AnsiWriter<W>
Source§impl<W: Write> TerminalOutput for AnsiWriter<W>
impl<W: Write> TerminalOutput for AnsiWriter<W>
Auto Trait Implementations§
impl<W> Freeze for AnsiWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for AnsiWriter<W>where
W: RefUnwindSafe,
impl<W> Send for AnsiWriter<W>where
W: Send,
impl<W> Sync for AnsiWriter<W>where
W: Sync,
impl<W> Unpin for AnsiWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for AnsiWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for AnsiWriter<W>where
W: UnwindSafe,
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