pub struct ErrHandler<E: Write> { /* private fields */ }
Expand description
ErrHandler
handles errors, writing errors and/or perodic reports to the
speicifed file or stderr. see StatusLevel
and
NOERROR
ErrHandler handles errors and progress information by writing to it’s
internal writer.
Implementations§
Source§impl<E: Write> ErrHandler<E>
impl<E: Write> ErrHandler<E>
Sourcepub const BLOCK_THRESHOLD_FOR_REPORT: usize = 25usize
pub const BLOCK_THRESHOLD_FOR_REPORT: usize = 25usize
threshold of blocks written per report.
Sourcepub const LINE_THRESHOLD_FOR_REPORT: usize = 20usize
pub const LINE_THRESHOLD_FOR_REPORT: usize = 20usize
threshold of lines written per report.
Sourcepub const STANDARD_BYTE_THRESHOLD: usize = 5_000_000usize
pub const STANDARD_BYTE_THRESHOLD: usize = 5_000_000usize
threshold of bytes written per erport
Sourcepub fn handle<T>(&mut self, res: Result<T>) -> Result<Option<T>>
pub fn handle<T>(&mut self, res: Result<T>) -> Result<Option<T>>
handle an error, promoting it unless continue_on_error
is set.
Sourcepub fn report_status_standard(
&mut self,
bytes: usize,
start: &SystemTime,
) -> Result<()>
pub fn report_status_standard( &mut self, bytes: usize, start: &SystemTime, ) -> Result<()>
report status during standard operation
pub fn report_status_block(&mut self, lines: usize, start: &SystemTime)
pub fn report_status_unblock(&mut self, blocks: usize, start: &SystemTime)
Trait Implementations§
Source§impl<E: Write> Write for ErrHandler<E>
impl<E: Write> Write for ErrHandler<E>
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl<E> Freeze for ErrHandler<E>where
E: Freeze,
impl<E> RefUnwindSafe for ErrHandler<E>where
E: RefUnwindSafe,
impl<E> Send for ErrHandler<E>where
E: Send,
impl<E> Sync for ErrHandler<E>where
E: Sync,
impl<E> Unpin for ErrHandler<E>where
E: Unpin,
impl<E> UnwindSafe for ErrHandler<E>where
E: 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