Struct osmpbf::elements::Way[][src]

pub struct Way<'a> { /* fields omitted */ }
Expand description

An OpenStreetMap way element (See OSM wiki).

A way contains an ordered list of node references that can be accessed with the refs or the raw_refs method.

Implementations

Returns the way id.

Returns an iterator over the tags of this way (See OSM wiki). A tag is represented as a pair of strings (key and value).

Example
use osmpbf::*;

let reader = ElementReader::from_path("tests/test.osm.pbf")?;

reader.for_each(|element| {
    if let Element::Way(way) = element {
        for (key, value) in way.tags() {
            println!("key: {}, value: {}", key, value);
        }
    }
})?;

Returns additional metadata for this element.

Returns an iterator over the references of this way. Each reference should correspond to a node id.

Returns a slice of delta coded node ids.

Returns an iterator over the tags of this way (See OSM wiki). A tag is represented as a pair of indices (key and value) to the stringtable of the current PrimitiveBlock.

Returns the raw stringtable. Elements in a PrimitiveBlock do not store strings themselves; instead, they just store indices to a common stringtable. By convention, the contained strings are UTF-8 encoded but it is not safe to assume that (use std::str::from_utf8).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.