pub enum Collector {
File(FileInfo),
Ram(Vec<u8>),
RamAndHeaders(Vec<u8>, Vec<u8>),
FileAndHeaders(FileInfo, Vec<u8>),
}
Expand description
Collector::File(FileInfo) is used to be able to download and upload files.
Collector::Ram(Vec<u8>
) is used to store response body into Memory.
Collector::RamWithHeaders(Vec<u8>
, Vec<u8>
) is used to store response body into Memory and with complete headers.
Collector::FileAndHeaders(FileInfo
, Vec<u8>
) is used to be able to download and upload files and with complete headers.
Variants§
File(FileInfo)
Collector::File(FileInfo
) is used to be able to download and upload files.
Ram(Vec<u8>)
Collector::Ram(Vec<u8>
) is used to store response body into Memory.
RamAndHeaders(Vec<u8>, Vec<u8>)
Collector::RamWithHeaders(Vec<u8>
, Vec<u8>
) is used to store response body into Memory and with complete headers.
FileAndHeaders(FileInfo, Vec<u8>)
Collector::FileAndHeaders(FileInfo
, Vec<u8>
) is used to be able to download and upload files and with complete headers.
Trait Implementations§
Source§impl ExtendedHandler for Collector
impl ExtendedHandler for Collector
Source§fn get_response_body(&self) -> Option<Vec<u8>>
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§fn get_response_body_and_headers(&self) -> (Option<Vec<u8>>, Option<HeaderMap>)
fn get_response_body_and_headers(&self) -> (Option<Vec<u8>>, Option<HeaderMap>)
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.
If Collector::RamAndHeaders(Vec<u8>
, Vec<u8>
) is set, the response body and the complete headers are generated.
If Collector::FileAndHeaders(FileInfo
, Vec<u8>
) is set, there will be no response body since the response will be stored into a file but a complete headers are generated.
Source§impl Handler for Collector
impl Handler for Collector
Source§fn write(&mut self, data: &[u8]) -> Result<usize, WriteError>
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>
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).