/// Download market data of a region
Download market data of a region
Download market data of a region
fn download_region(region_id: RegionID,
                   client: esi::Client,
                   uni: universe::Universe,
                   reschedule_channel: channel::Sender<(RegionID, DateTime<Utc>)>)
                   -> Result<store::TaggedOrderVec> {
    // Collect thread's handles for later joins
    // It needs mutable access to the client because of auth and to uni because of the blacklists
    let structure_handle = download_region_structures(region_id, client.clone(), uni);
    let region_handle = download_region_market(region_id, client, reschedule_channel);
    let mut orders: store::TaggedOrderVec = Vec::new();
    // Unwrap thread panics
    let structure_result = structure_handle.join().unwrap();
    let region_result = region_handle.join().unwrap();
    // Unwrap data
    let mut orders_structure = structure_result?;
    let mut orders_region = region_result?;
    // Append and return data
    orders.append(&mut orders_structure);
    orders.append(&mut orders_region);
    Ok(orders)
}
fn download_region ( region_id : RegionID , client : esi :: Client , uni : universe :: Universe , reschedule_channel : channel :: Sender < ( RegionID , DateTime < Utc > ) > ) -> Result < store :: TaggedOrderVec > { // Collect thread's handles for later joins // It needs mutable access to the client because of auth and to uni because of the blacklists let structure_handle = download_region_structures ( region_id , client . clone ( ) , uni ) ; let region_handle = download_region_market ( region_id , client , reschedule_channel ) ; let mut orders : store :: TaggedOrderVec = Vec :: new ( ) ; // Unwrap thread panics let structure_result = structure_handle . join ( ) . unwrap ( ) ; let region_result = region_handle . join ( ) . unwrap ( ) ; // Unwrap data let mut orders_structure = structure_result ? ; let mut orders_region = region_result ? ; // Append and return data orders . append ( & mut orders_structure ) ; orders . append ( & mut orders_region ) ; Ok ( orders ) }
Download market data of a region
Download market data of a region
region_id
RegionID
client
esi::Client
uni
universe::Universe
reschedule_channel
channel::Sender<(RegionID, DateTime<Utc>)>