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
sourceimpl<'easy, 'data> Transfer<'easy, 'data>
impl<'easy, 'data> Transfer<'easy, 'data>
sourcepub fn write_function<F>(&mut self, f: F) -> Result<(), Error> where
F: FnMut(&[u8]) -> Result<usize, WriteError> + 'data,
pub fn write_function<F>(&mut self, f: F) -> Result<(), Error> where
F: FnMut(&[u8]) -> Result<usize, WriteError> + 'data,
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> where
F: FnMut(&mut [u8]) -> Result<usize, ReadError> + 'data,
pub fn read_function<F>(&mut self, f: F) -> Result<(), Error> where
F: FnMut(&mut [u8]) -> Result<usize, ReadError> + 'data,
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> where
F: FnMut(SeekFrom) -> SeekResult + 'data,
pub fn seek_function<F>(&mut self, f: F) -> Result<(), Error> where
F: FnMut(SeekFrom) -> SeekResult + 'data,
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> where
F: FnMut(f64, f64, f64, f64) -> bool + 'data,
pub fn progress_function<F>(&mut self, f: F) -> Result<(), Error> where
F: FnMut(f64, f64, f64, f64) -> bool + 'data,
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> where
F: FnMut(*mut c_void) -> Result<(), Error> + Send + 'data,
pub fn ssl_ctx_function<F>(&mut self, f: F) -> Result<(), Error> where
F: FnMut(*mut c_void) -> Result<(), Error> + Send + 'data,
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> where
F: FnMut(InfoType, &[u8]) + 'data,
pub fn debug_function<F>(&mut self, f: F) -> Result<(), Error> where
F: FnMut(InfoType, &[u8]) + 'data,
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> where
F: FnMut(&[u8]) -> bool + 'data,
pub fn header_function<F>(&mut self, f: F) -> Result<(), Error> where
F: FnMut(&[u8]) -> bool + 'data,
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
Trait Implementations
Auto Trait Implementations
impl<'easy, 'data> !RefUnwindSafe for Transfer<'easy, 'data>
impl<'easy, 'data> !Send for Transfer<'easy, 'data>
impl<'easy, 'data> !Sync for Transfer<'easy, 'data>
impl<'easy, 'data> Unpin for Transfer<'easy, 'data>
impl<'easy, 'data> !UnwindSafe for Transfer<'easy, 'data>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more