1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use groups;
use objects::{Node, OsmObj, Relation, Way};
use osmformat::PrimitiveBlock;
pub_iterator_type! {
#[doc="Iterator on the `OsmObj` of a `PrimitiveBlock`."]
OsmObjs['a] = Box<Iterator<Item = OsmObj> + 'a>
}
pub fn iter(block: &PrimitiveBlock) -> OsmObjs {
let f = move |g| groups::iter(g, block);
OsmObjs(Box::new(block.get_primitivegroup().iter().flat_map(f)))
}
pub_iterator_type! {
#[doc="Iterator on the `Node` of a `PrimitiveBlock`."]
Nodes['a] = Box<Iterator<Item = Node> + 'a>
}
pub fn nodes(block: &PrimitiveBlock) -> Nodes {
let f = move |g| groups::nodes(g, block);
Nodes(Box::new(block.get_primitivegroup().iter().flat_map(f)))
}
pub_iterator_type! {
#[doc="Iterator on the `Way` of a `PrimitiveBlock`."]
Ways['a] = Box<Iterator<Item = Way> + 'a>
}
pub fn ways(block: &PrimitiveBlock) -> Ways {
let f = move |g| groups::ways(g, block);
Ways(Box::new(block.get_primitivegroup().iter().flat_map(f)))
}
pub_iterator_type! {
#[doc="Iterator on the `Relation` of a `PrimitiveBlock`."]
Relations['a] = Box<Iterator<Item = Relation> + 'a>
}
pub fn relations(block: &PrimitiveBlock) -> Relations {
let f = move |g| groups::relations(g, block);
Relations(Box::new(block.get_primitivegroup().iter().flat_map(f)))
}