Struct ffsend_api::reader::ProgressWriter [−][src]
pub struct ProgressWriter<W> { /* fields omitted */ }A writer wrapper, that measures the reading process for a writer with a known length.
If the writer exceeds the initially specified length, the writer will continue to allow reads. The length property will grow accordingly.
The writer will only start producing None if the wrapped writer is doing
so.
Methods
impl<W: Write> ProgressWriter<W>[src]
impl<W: Write> ProgressWriter<W>pub fn new(inner: W) -> Result<Self, IoError> where
W: ExactLengthReader, [src]
pub fn new(inner: W) -> Result<Self, IoError> where
W: ExactLengthReader, Wrap the given writer with an exact length, in a progress writer.
pub fn from(inner: W, len: u64) -> Self[src]
pub fn from(inner: W, len: u64) -> SelfWrap the given writer with the given length in a progress writer.
pub fn set_reporter(&mut self, reporter: Arc<Mutex<ProgressReporter>>)[src]
pub fn set_reporter(&mut self, reporter: Arc<Mutex<ProgressReporter>>)Set the reporter to report the status to.
pub fn progress(&self) -> u64[src]
pub fn progress(&self) -> u64Get the current progress.
pub fn unwrap(self) -> W[src]
pub fn unwrap(self) -> WUnwrap the inner from the progress writer.
Trait Implementations
impl<W: Write> Write for ProgressWriter<W>[src]
impl<W: Write> Write for ProgressWriter<W>fn write(&mut self, buf: &[u8]) -> Result<usize, Error>[src]
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>Write a buffer into this object, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<(), IoError>[src]
fn flush(&mut self) -> Result<(), IoError>Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>1.0.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>Attempts to write an entire buffer into this write. Read more
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>1.0.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>Writes a formatted string into this writer, returning any error encountered. Read more
ⓘImportant traits for &'a mut Rfn by_ref(&mut self) -> &mut Self1.0.0[src]
fn by_ref(&mut self) -> &mut SelfCreates a "by reference" adaptor for this instance of Write. Read more
impl<W: Write> ExactLengthReader for ProgressWriter<W>[src]
impl<W: Write> ExactLengthReader for ProgressWriter<W>Auto Trait Implementations
impl<W> Send for ProgressWriter<W> where
W: Send,
impl<W> Send for ProgressWriter<W> where
W: Send, impl<W> Sync for ProgressWriter<W> where
W: Sync,
impl<W> Sync for ProgressWriter<W> where
W: Sync,