pub struct Transfer<'easy, 'data> { /* private fields */ }
Expand description
A scoped transfer of information which borrows an Easy
and allows
referencing stack-local data of the lifetime 'data
.
Usage of Easy
requires the 'static
and Send
bounds on all callbacks
registered, but that’s not often wanted if all you need is to collect a
bunch of data in memory to a vector, for example. The Transfer
structure,
created by the Easy::transfer
method, is used for this sort of request.
The callbacks attached to a Transfer
are only active for that one transfer
object, and they allow to elide both the Send
and 'static
bounds to
close over stack-local information.
Implementations§
Source§impl<'easy, 'data> Transfer<'easy, 'data>
impl<'easy, 'data> Transfer<'easy, 'data>
Sourcepub fn write_function<F>(&mut self, f: F) -> Result<(), Error>
pub fn write_function<F>(&mut self, f: F) -> Result<(), Error>
Same as Easy::write_function
, just takes a non 'static
lifetime
corresponding to the lifetime of this transfer.
Sourcepub fn read_function<F>(&mut self, f: F) -> Result<(), Error>
pub fn read_function<F>(&mut self, f: F) -> Result<(), Error>
Same as Easy::read_function
, just takes a non 'static
lifetime
corresponding to the lifetime of this transfer.
Sourcepub fn seek_function<F>(&mut self, f: F) -> Result<(), Error>
pub fn seek_function<F>(&mut self, f: F) -> Result<(), Error>
Same as Easy::seek_function
, just takes a non 'static
lifetime
corresponding to the lifetime of this transfer.
Sourcepub fn progress_function<F>(&mut self, f: F) -> Result<(), Error>
pub fn progress_function<F>(&mut self, f: F) -> Result<(), Error>
Same as Easy::progress_function
, just takes a non 'static
lifetime
corresponding to the lifetime of this transfer.
Sourcepub fn ssl_ctx_function<F>(&mut self, f: F) -> Result<(), Error>
pub fn ssl_ctx_function<F>(&mut self, f: F) -> Result<(), Error>
Same as Easy::ssl_ctx_function
, just takes a non 'static
lifetime corresponding to the lifetime of this transfer.
Sourcepub fn debug_function<F>(&mut self, f: F) -> Result<(), Error>
pub fn debug_function<F>(&mut self, f: F) -> Result<(), Error>
Same as Easy::debug_function
, just takes a non 'static
lifetime
corresponding to the lifetime of this transfer.
Sourcepub fn header_function<F>(&mut self, f: F) -> Result<(), Error>
pub fn header_function<F>(&mut self, f: F) -> Result<(), Error>
Same as Easy::header_function
, just takes a non 'static
lifetime
corresponding to the lifetime of this transfer.
Sourcepub fn unpause_read(&self) -> Result<(), Error>
pub fn unpause_read(&self) -> Result<(), Error>
Same as Easy::unpause_read
.
Sourcepub fn unpause_write(&self) -> Result<(), Error>
pub fn unpause_write(&self) -> Result<(), Error>
Same as Easy::unpause_write