fn add_to_indices(store: &mut RwLockWriteGuard<InnerStore>,
                  order_id: OrderID,
                  type_id: TypeID,
                  region_id: RegionID) {
    // Add type if unknown
    store.types
         .entry(type_id)
         .or_insert_with(FnvHashSet::default);

    // Add order ID to type index
    store.types.get_mut(&type_id).unwrap().insert(order_id);

    // Add region if unknown
    store.regions
         .entry(region_id)
         .or_insert_with(FnvHashSet::default);

    // Add order ID to region index
    store.regions.get_mut(&region_id).unwrap().insert(order_id);

    // Add region type if unknown
    let region_type: RegionType = (region_id, type_id);

    store.region_types
         .entry(region_type)
         .or_insert_with(FnvHashSet::default);

    // Add order ID to region type index
    store.region_types
         .get_mut(&region_type)
         .unwrap()
         .insert(order_id);
}
/// Add new order to indices in store
Add new order to indices in store
Add new order to indices in store
fn add_to_indices(store: &mut RwLockWriteGuard<InnerStore>,
                  order_id: OrderID,
                  type_id: TypeID,
                  region_id: RegionID) {
    // Add type if unknown
    store.types
         .entry(type_id)
         .or_insert_with(FnvHashSet::default);
    // Add order ID to type index
    store.types.get_mut(&type_id).unwrap().insert(order_id);
    // Add region if unknown
    store.regions
         .entry(region_id)
         .or_insert_with(FnvHashSet::default);
    // Add order ID to region index
    store.regions.get_mut(&region_id).unwrap().insert(order_id);
    // Add region type if unknown
    let region_type: RegionType = (region_id, type_id);
    store.region_types
         .entry(region_type)
         .or_insert_with(FnvHashSet::default);
    // Add order ID to region type index
    store.region_types
         .get_mut(&region_type)
         .unwrap()
         .insert(order_id);
}
fn add_to_indices ( store : & mut RwLockWriteGuard < InnerStore > , order_id : OrderID , type_id : TypeID , region_id : RegionID ) { // Add type if unknown store . types . entry ( type_id ) . or_insert_with ( FnvHashSet :: default ) ; // Add order ID to type index store . types . get_mut ( & type_id ) . unwrap ( ) . insert ( order_id ) ; // Add region if unknown store . regions . entry ( region_id ) . or_insert_with ( FnvHashSet :: default ) ; // Add order ID to region index store . regions . get_mut ( & region_id ) . unwrap ( ) . insert ( order_id ) ; // Add region type if unknown let region_type : RegionType = ( region_id , type_id ) ; store . region_types . entry ( region_type ) . or_insert_with ( FnvHashSet :: default ) ; // Add order ID to region type index store . region_types . get_mut ( & region_type ) . unwrap ( ) . insert ( order_id ) ; }
Add new order to indices in store
Add new order to indices in store
store
&mut RwLockWriteGuard<InnerStore>
order_id
OrderID
type_id
TypeID
region_id
RegionID
store
&mut RwLockWriteGuard<InnerStore>
order_id
OrderID
type_id
TypeID
region_id
RegionID