Struct anstyle_wincon::Console
source · pub struct Console<S>where
S: WinconStream + Write,{ /* private fields */ }
Expand description
Write colored text to the screen
Implementations§
source§impl<S> Console<S>where
S: WinconStream + Write,
impl<S> Console<S>where S: WinconStream + Write,
pub fn new(stream: S) -> Result<Self, S>
sourcepub fn write(
&mut self,
fg: Option<AnsiColor>,
bg: Option<AnsiColor>,
data: &[u8]
) -> Result<usize>
pub fn write( &mut self, fg: Option<AnsiColor>, bg: Option<AnsiColor>, data: &[u8] ) -> Result<usize>
Write colored text to the screen
pub fn flush(&mut self) -> Result<()>
sourcepub fn map<S1: WinconStream + Write>(
self,
op: impl FnOnce(S) -> S1
) -> Console<S1>
pub fn map<S1: WinconStream + Write>( self, op: impl FnOnce(S) -> S1 ) -> Console<S1>
Allow changing the stream
sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Get the inner writer
source§impl<S> Console<S>where
S: WinconStream + Write + Lockable,
<S as Lockable>::Locked: WinconStream + Write,
impl<S> Console<S>where S: WinconStream + Write + Lockable, <S as Lockable>::Locked: WinconStream + Write,
Trait Implementations§
Auto Trait Implementations§
impl<S> RefUnwindSafe for Console<S>where S: RefUnwindSafe,
impl<S> Send for Console<S>where S: Send,
impl<S> Sync for Console<S>where S: Sync,
impl<S> Unpin for Console<S>where S: Unpin,
impl<S> UnwindSafe for Console<S>where S: 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