pub trait AsyncWriterFactory {
// Required method
fn get_writer<'a, 'async_trait>(
&'a mut self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncWrite + Unpin + 'a>>> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait;
}
Expand description
An AsyncWriterFactory can produce, on demand, an AsyncWrite object. In the event of a download failure, the restarted download will use a fresh writer to restart writing at the beginning.
Required Methods§
Sourcefn get_writer<'a, 'async_trait>(
&'a mut self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncWrite + Unpin + 'a>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_writer<'a, 'async_trait>(
&'a mut self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn AsyncWrite + Unpin + 'a>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Get a fresh AsyncWrite object, positioned at the point where downloaded data should be written.