Struct ore::retry::RetryReader [−][src]
pub struct RetryReader<F, U, R> {
factory: F,
offset: usize,
error: Option<Error>,
retry: RetryStream,
state: RetryReaderState<U, R>,
}
network
only.Expand description
Wrapper of a Reader
factory that will automatically retry and resume reading an underlying
resource in the events of errors according to a retry schedule.
Fields
factory: F
offset: usize
error: Option<Error>
retry: RetryStream
state: RetryReaderState<U, R>
Implementations
impl<F, U, R> RetryReader<F, U, R> where
F: FnMut(RetryState, usize) -> U,
U: Future<Output = Result<R, Error>>,
R: AsyncRead,
impl<F, U, R> RetryReader<F, U, R> where
F: FnMut(RetryState, usize) -> U,
U: Future<Output = Result<R, Error>>,
R: AsyncRead,
Uses the provided Reader
factory to construct a RetryReader
with the default Retry
settings.
The factory will be called once at the beginning and subsequently every time a retry
attempt is made. The factory will be called with a single usize
argument representing the
offset at which the returned Reader
should resume reading from.
Uses the provided Reader
factory to construct a RetryReader
with the passed Retry
settings. See the documentation of RetryReader::new for more detais.
Trait Implementations
impl<F, U, R> AsyncRead for RetryReader<F, U, R> where
F: FnMut(RetryState, usize) -> U,
U: Future<Output = Result<R, Error>>,
R: AsyncRead,
impl<F, U, R> AsyncRead for RetryReader<F, U, R> where
F: FnMut(RetryState, usize) -> U,
U: Future<Output = Result<R, Error>>,
R: AsyncRead,
Auto Trait Implementations
impl<F, U, R> !RefUnwindSafe for RetryReader<F, U, R>
impl<F, U, R> Send for RetryReader<F, U, R> where
F: Send,
R: Send,
U: Send,
impl<F, U, R> Sync for RetryReader<F, U, R> where
F: Sync,
R: Sync,
U: Sync,
impl<F, U, R> !UnwindSafe for RetryReader<F, U, R>
Blanket Implementations
Creates a new AsyncRead
instance that chains this stream with
next
. Read more
Pulls some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Pulls some bytes from this source into the specified buffer, advancing the buffer’s internal cursor. Read more
Reads the exact number of bytes required to fill buf
. Read more
Reads an unsigned 8 bit integer from the underlying reader. Read more
Reads a signed 8 bit integer from the underlying reader. Read more
Reads an unsigned 16-bit integer in big-endian order from the underlying reader. Read more
Reads a signed 16-bit integer in big-endian order from the underlying reader. Read more
Reads an unsigned 32-bit integer in big-endian order from the underlying reader. Read more
Reads a signed 32-bit integer in big-endian order from the underlying reader. Read more
Reads an unsigned 64-bit integer in big-endian order from the underlying reader. Read more
Reads an signed 64-bit integer in big-endian order from the underlying reader. Read more
Reads an unsigned 128-bit integer in big-endian order from the underlying reader. Read more
Reads an signed 128-bit integer in big-endian order from the underlying reader. Read more
Reads an 32-bit floating point type in big-endian order from the underlying reader. Read more
Reads an 64-bit floating point type in big-endian order from the underlying reader. Read more
Reads an unsigned 16-bit integer in little-endian order from the underlying reader. Read more
Reads a signed 16-bit integer in little-endian order from the underlying reader. Read more
Reads an unsigned 32-bit integer in little-endian order from the underlying reader. Read more
Reads a signed 32-bit integer in little-endian order from the underlying reader. Read more
Reads an unsigned 64-bit integer in little-endian order from the underlying reader. Read more
Reads an signed 64-bit integer in little-endian order from the underlying reader. Read more
Reads an unsigned 128-bit integer in little-endian order from the underlying reader. Read more
Reads an signed 128-bit integer in little-endian order from the underlying reader. Read more
Reads an 32-bit floating point type in little-endian order from the underlying reader. Read more
Reads an 64-bit floating point type in little-endian order from the underlying reader. Read more
Reads all bytes until EOF in this source, placing them into buf
. Read more
fn read_to_string(&'a mut self, dst: &'a mut String) -> ReadToString<'a, Self> where
Self: Unpin,
fn read_to_string(&'a mut self, dst: &'a mut String) -> ReadToString<'a, Self> where
Self: Unpin,
Reads all bytes until EOF in this source, appending them to buf
. Read more
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more