[][src]Struct curl::easy::Transfer

pub struct Transfer<'easy, 'data> { /* fields omitted */ }

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.

Methods

impl<'easy, 'data> Transfer<'easy, 'data>[src]

pub fn write_function<F>(&mut self, f: F) -> Result<(), Error> where
    F: FnMut(&[u8]) -> Result<usize, WriteError> + 'data, 
[src]

Same as Easy::write_function, just takes a non 'static lifetime corresponding to the lifetime of this transfer.

pub fn read_function<F>(&mut self, f: F) -> Result<(), Error> where
    F: FnMut(&mut [u8]) -> Result<usize, ReadError> + 'data, 
[src]

Same as Easy::read_function, just takes a non 'static lifetime corresponding to the lifetime of this transfer.

pub fn seek_function<F>(&mut self, f: F) -> Result<(), Error> where
    F: FnMut(SeekFrom) -> SeekResult + 'data, 
[src]

Same as Easy::seek_function, just takes a non 'static lifetime corresponding to the lifetime of this transfer.

pub fn progress_function<F>(&mut self, f: F) -> Result<(), Error> where
    F: FnMut(f64, f64, f64, f64) -> bool + 'data, 
[src]

Same as Easy::progress_function, just takes a non 'static lifetime corresponding to the lifetime of this transfer.

pub fn ssl_ctx_function<F>(&mut self, f: F) -> Result<(), Error> where
    F: FnMut(*mut c_void) -> Result<(), Error> + Send + 'data, 
[src]

Same as Easy::ssl_ctx_function, just takes a non 'static lifetime corresponding to the lifetime of this transfer.

pub fn debug_function<F>(&mut self, f: F) -> Result<(), Error> where
    F: FnMut(InfoType, &[u8]) + 'data, 
[src]

Same as Easy::debug_function, just takes a non 'static lifetime corresponding to the lifetime of this transfer.

pub fn header_function<F>(&mut self, f: F) -> Result<(), Error> where
    F: FnMut(&[u8]) -> bool + 'data, 
[src]

Same as Easy::header_function, just takes a non 'static lifetime corresponding to the lifetime of this transfer.

pub fn perform(&self) -> Result<(), Error>[src]

Same as Easy::perform.

pub fn unpause_read(&self) -> Result<(), Error>[src]

Same as Easy::unpause_read.

pub fn unpause_write(&self) -> Result<(), Error>[src]

Same as Easy::unpause_write

Trait Implementations

impl<'easy, 'data> Drop for Transfer<'easy, 'data>[src]

impl<'easy, 'data> Debug for Transfer<'easy, 'data>[src]

Auto Trait Implementations

impl<'easy, 'data> !Send for Transfer<'easy, 'data>

impl<'easy, 'data> Unpin for Transfer<'easy, 'data>

impl<'easy, 'data> !Sync for Transfer<'easy, 'data>

impl<'easy, 'data> !UnwindSafe for Transfer<'easy, 'data>

impl<'easy, 'data> !RefUnwindSafe for Transfer<'easy, 'data>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]