pub enum Collector {
    File(FileInfo),
    Ram(Vec<u8>),
}
Expand description

The Collector will handle two types in order to store data, via File or via RAM. Collector::File(FileInfo) is useful to be able to download and upload files. Collector::Ram(Vec<u8>) is used to store response body into Memory.

Variants§

§

File(FileInfo)

Collector::File(FileInfo) is useful to be able to download and upload files.

§

Ram(Vec<u8>)

Collector::Ram(Vec<u8>) is used to store response body into Memory.

Trait Implementations§

source§

impl Clone for Collector

source§

fn clone(&self) -> Collector

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Collector

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl ExtendedHandler for Collector

source§

fn get_response_body(&self) -> Option<Vec<u8>>

If Collector::File(FileInfo) is set, there will be no response body since the response will be stored into a file.

If Collector::Ram(Vec<u8>) is set, the response body can be obtain here.

source§

impl Handler for Collector

source§

fn write(&mut self, data: &[u8]) -> Result<usize, WriteError>

This will store the response from the server to the data vector or into a file depends on the Collector being used.

source§

fn read(&mut self, data: &mut [u8]) -> Result<usize, ReadError>

This will read the chunks of data from a file that will be uploaded to the server. This will be use if the Collector is Collector::File(FileInfo).

source§

fn seek(&mut self, whence: SeekFrom) -> SeekResult

User callback for seeking in input stream. Read more
source§

fn debug(&mut self, kind: InfoType, data: &[u8])

Specify a debug callback Read more
source§

fn header(&mut self, data: &[u8]) -> bool

Callback that receives header data Read more
source§

fn progress( &mut self, dltotal: f64, dlnow: f64, ultotal: f64, ulnow: f64 ) -> bool

Callback to progress meter function Read more
source§

fn ssl_ctx(&mut self, cx: *mut c_void) -> Result<(), Error>

Callback to SSL context Read more
source§

fn open_socket( &mut self, family: i32, socktype: i32, protocol: i32 ) -> Option<i32>

Callback to open sockets for libcurl. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.