pub struct Console { /* private fields */ }
Expand description
Wrapper over browser’s console
On Drop
performs flush
or requires manual flush
for written to be printed in the console.
Buffer capacity is 4096 bytes.
In case of overflow it dumps existing data to the console and overwrites with rest of it.
Implementations§
Source§impl Console
impl Console
Sourcepub const fn new(typ: ConsoleType) -> Self
pub const fn new(typ: ConsoleType) -> Self
Creates new instance
Sourcepub fn flush(&mut self)
pub fn flush(&mut self)
Flushes internal buffer, if any data is available.
Namely it dumps stored data in buffer via Console. And resets buffered length to 0.
Sourcepub fn write_data(&mut self, data: &[u8])
pub fn write_data(&mut self, data: &[u8])
Writes supplied text to the buffer.
On buffer overflow, data is logged via Console
and buffer is filled with the rest of data
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Console
impl RefUnwindSafe for Console
impl Send for Console
impl Sync for Console
impl Unpin for Console
impl UnwindSafe for Console
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