pub fn search_many<'a, O, G, I, F>(origin: &O, goal: G, opts: SearchOptions<'a, F>) -> SearchResults
where
    O: HasPosition,
    G: IntoIterator<Item = (I, u32)>,
    I: HasPosition,
    F: Fn(String) -> CostMatrix<'a> + 'a,
{
    let goals: Vec<Object> = goal
        .into_iter()
        .map(|(target, range)| {
            let pos = target.pos();
            js_unwrap!({pos: pos_from_packed(@{pos.packed_repr()}), range: @{range}})
        })
        .collect();
    let goals_js: Reference = js_unwrap!(@{goals});
    search_real(origin.pos(), &goals_js, opts)
}
/// Searches between a single origin and multiple goals.
Searches between a single origin and multiple goals.
Searches between a single origin and multiple goals .
pub fn search_many<'a, O, G, I, F>(origin: &O, goal: G, opts: SearchOptions<'a, F>) -> SearchResults
where
    O: HasPosition,
    G: IntoIterator<Item = (I, u32)>,
    I: HasPosition,
    F: Fn(String) -> CostMatrix<'a> + 'a,
{
    let goals: Vec<Object> = goal
        .into_iter()
        .map(|(target, range)| {
            let pos = target.pos();
            js_unwrap!({pos: pos_from_packed(@{pos.packed_repr()}), range: @{range}})
        })
        .collect();
    let goals_js: Reference = js_unwrap!(@{goals});
    search_real(origin.pos(), &goals_js, opts)
}
pub fn search_many < ' a , O , G , I , F > ( origin : & O , goal : G , opts : SearchOptions < ' a , F > ) -> SearchResults where O : HasPosition , G : IntoIterator < Item = ( I , u32 ) > , I : HasPosition , F : Fn ( String ) -> CostMatrix < ' a > + ' a , { let goals : Vec < Object > = goal . into_iter ( ) . map ( | ( target , range ) | { let pos = target . pos ( ) ; js_unwrap ! ( { pos pos_from_packed ( { pos packed_repr ( ) } ) range { range } } ) } ) . collect ( ) ; let goals_js : Reference = js_unwrap ! ( { goals } ) ; search_real ( origin . pos ( ) , & goals_js , opts ) }
Searches between a single origin and multiple goals.
Searches between a single origin and multiple goals .
origin
&O
goal
G
opts
SearchOptions<'a, F>