|
|
@@ -8,6 +8,7 @@ use std;
|
|
8
|
8
|
|
|
9
|
9
|
|
|
10
|
10
|
/// An OpenStreetMap node element (See [OSM wiki](http://wiki.openstreetmap.org/wiki/Node)).
|
|
|
11
|
+#[derive(Clone, Debug)]
|
|
11
|
12
|
pub struct Node<'a> {
|
|
12
|
13
|
block: &'a PrimitiveBlock,
|
|
13
|
14
|
osmnode: &'a osmformat::Node,
|
|
|
@@ -60,6 +61,7 @@ impl<'a> Node<'a> {
|
|
60
|
61
|
///
|
|
61
|
62
|
/// A way contains an ordered list of node references that can be accessed with the `refs` or the
|
|
62
|
63
|
/// `refs_slice` method.
|
|
|
64
|
+#[derive(Clone, Debug)]
|
|
63
|
65
|
pub struct Way<'a> {
|
|
64
|
66
|
block: &'a PrimitiveBlock,
|
|
65
|
67
|
osmway: &'a osmformat::Way,
|
|
|
@@ -110,6 +112,7 @@ impl<'a> Way<'a> {
|
|
110
|
112
|
/// An OpenStreetMap relation element (See [OSM wiki](http://wiki.openstreetmap.org/wiki/Relation)).
|
|
111
|
113
|
///
|
|
112
|
114
|
/// A relation contains an ordered list of members that can be of any element type.
|
|
|
115
|
+#[derive(Clone, Debug)]
|
|
113
|
116
|
pub struct Relation<'a> {
|
|
114
|
117
|
block: &'a PrimitiveBlock,
|
|
115
|
118
|
osmrel: &'a osmformat::Relation,
|
|
|
@@ -151,6 +154,7 @@ impl<'a> Relation<'a> {
|
|
151
|
154
|
/// An iterator over the references of a way.
|
|
152
|
155
|
///
|
|
153
|
156
|
/// Each reference corresponds to a node id.
|
|
|
157
|
+#[derive(Clone, Debug)]
|
|
154
|
158
|
pub struct WayRefIter<'a> {
|
|
155
|
159
|
deltas: std::slice::Iter<'a, i64>,
|
|
156
|
160
|
current: i64,
|
|
|
@@ -177,6 +181,7 @@ impl<'a> Iterator for WayRefIter<'a> {
|
|
177
|
181
|
impl<'a> ExactSizeIterator for WayRefIter<'a> {}
|
|
178
|
182
|
|
|
179
|
183
|
/// The element type of a relation member.
|
|
|
184
|
+#[derive(Clone, Debug, Eq, PartialEq)]
|
|
180
|
185
|
pub enum RelMemberType {
|
|
181
|
186
|
Node,
|
|
182
|
187
|
Way,
|
|
|
@@ -197,6 +202,7 @@ impl From<osmformat::Relation_MemberType> for RelMemberType {
|
|
197
|
202
|
/// A member of a relation.
|
|
198
|
203
|
///
|
|
199
|
204
|
/// Each member has a member type and a member id that references an element of that type.
|
|
|
205
|
+#[derive(Clone, Debug)]
|
|
200
|
206
|
pub struct RelMember<'a> {
|
|
201
|
207
|
block: &'a PrimitiveBlock,
|
|
202
|
208
|
pub role_sid: i32,
|
|
|
@@ -212,6 +218,7 @@ impl<'a> RelMember<'a> {
|
|
212
|
218
|
}
|
|
213
|
219
|
|
|
214
|
220
|
/// An iterator over the members of a relation.
|
|
|
221
|
+#[derive(Clone, Debug)]
|
|
215
|
222
|
pub struct RelMemberIter<'a> {
|
|
216
|
223
|
block: &'a PrimitiveBlock,
|
|
217
|
224
|
role_sids: std::slice::Iter<'a, i32>,
|
|
|
@@ -260,6 +267,7 @@ impl<'a> Iterator for RelMemberIter<'a> {
|
|
260
|
267
|
impl<'a> ExactSizeIterator for RelMemberIter<'a> {}
|
|
261
|
268
|
|
|
262
|
269
|
/// An iterator over the tags of an element.
|
|
|
270
|
+#[derive(Clone, Debug)]
|
|
263
|
271
|
pub struct TagIter<'a> {
|
|
264
|
272
|
block: &'a PrimitiveBlock,
|
|
265
|
273
|
key_indices: std::slice::Iter<'a, u32>,
|
|
|
@@ -293,6 +301,7 @@ impl<'a> Iterator for TagIter<'a> {
|
|
293
|
301
|
impl<'a> ExactSizeIterator for TagIter<'a> {}
|
|
294
|
302
|
|
|
295
|
303
|
/// Additional metadata that might be included in each element.
|
|
|
304
|
+#[derive(Clone, Debug)]
|
|
296
|
305
|
pub struct Info<'a> {
|
|
297
|
306
|
block: &'a PrimitiveBlock,
|
|
298
|
307
|
info: &'a osmformat::Info,
|