pub struct Writer {
pub prefix_len: u16,
/* private fields */
}Fields§
§prefix_len: u16Implementations§
Source§impl Writer
impl Writer
pub fn new(prefix_len: u16) -> Self
pub fn new_no_limit_length(prefix_len: u16) -> Self
pub fn new_stdout() -> Self
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
See environment is terminal
Sourcepub fn show_cursor(&self) -> Result<()>
pub fn show_cursor(&self) -> Result<()>
Show terminal cursor
Sourcepub fn get_max_len(&self) -> u16
pub fn get_max_len(&self) -> u16
Get terminal max len to writer message to terminal
Sourcepub fn get_height(&self) -> u16
pub fn get_height(&self) -> u16
Get terminal height
Sourcepub fn get_length(&self) -> u16
pub fn get_length(&self) -> u16
Get terminal width
Sourcepub fn get_writer(&self) -> Box<dyn Write>
pub fn get_writer(&self) -> Box<dyn Write>
Get writer to write something to terminal
Sourcepub fn write_prefix(&self, prefix: &str) -> Result<()>
pub fn write_prefix(&self, prefix: &str) -> Result<()>
Write oma-style message prefix to terminal
pub fn get_prefix_len(&self) -> u16
pub fn write_chunks<S: AsRef<str>>( &self, prefix: &str, chunks: &[S], prefix_len: u16, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Writer
impl RefUnwindSafe for Writer
impl Send for Writer
impl Sync for Writer
impl Unpin for Writer
impl UnwindSafe for Writer
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