pub struct Plain<T> { /* private fields */ }Available on crate feature
std only.Expand description
An adaptor to allow writing stylish attributed data to an output stream
by discarding style attributes.
let mut writer = stylish::io::Plain::new(Vec::new());
stylish::write!(writer, "Hello {:(fg=red)}", "Ferris")?;
assert_eq!(writer.into_inner(), b"Hello Ferris");Implementations§
Trait Implementations§
Source§impl<T: Write> Write for Plain<T>
impl<T: Write> Write for Plain<T>
Source§fn write(&mut self, s: &[u8], _style: Style) -> Result<usize>
fn write(&mut self, s: &[u8], _style: Style) -> Result<usize>
Write a buffer into this writer with a specified style, returning how
many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn write_all(&mut self, s: &[u8], _style: Style) -> Result<()>
fn write_all(&mut self, s: &[u8], _style: Style) -> Result<()>
Attempts to write an entire buffer into this writer using a specified
style. Read more
Auto Trait Implementations§
impl<T> Freeze for Plain<T>where
T: Freeze,
impl<T> RefUnwindSafe for Plain<T>where
T: RefUnwindSafe,
impl<T> Send for Plain<T>where
T: Send,
impl<T> Sync for Plain<T>where
T: Sync,
impl<T> Unpin for Plain<T>where
T: Unpin,
impl<T> UnwindSafe for Plain<T>where
T: 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