Crate network_communicator [−] [src]
Description
Creates thread pool for downloading content. It's provides channel for sending requests and receiving results.
Example
extern crate network_communicator; extern crate curl; use network_communicator::NetworkManagerHandle; use network_communicator::NetworkManager; use network_communicator::Config; use network_communicator::Task; use std::sync::{Arc,Mutex};
struct Payload {
input: Arc
impl Payload { fn new() -> Payload { Payload { input: Arc::new(Mutex::new(vec![])), } } }
fn network_manager() -> NetworkManagerHandle
return manager;
}
fn get_request(url:&str) -> Task
let manager = network_manager(); manager.send(get_request("https://github.com")).expect("Unable to send request"); manager.send(get_request("https://rust-lang.org")).expect("Unable to send request");
Structs
Config |
Structure for configuration. |
NetworkManager |
Manager for processsing request. |
NetworkManagerHandle |
Handle for working with network manager. |
Enums
ConfigError |
Errors in configuration. |
Error |
Errors during starting download manager or processing request. |
Task |
Task for network manager. |
Type Definitions
RequestDownloaderResult |
Result of working network manager. |