Trait Way

Source
pub trait Way: OSMObjBase {
    // Required methods
    fn nodes(&self) -> &[ObjId] ;
    fn num_nodes(&self) -> usize;
    fn node(&self, idx: usize) -> Option<ObjId>;
    fn set_nodes(&mut self, nodes: impl IntoIterator<Item = impl Into<ObjId>>);

    // Provided methods
    fn nids(&self) -> &[ObjId]  { ... }
    fn is_closed(&self) -> bool { ... }
    fn is_area(&self) -> bool { ... }
}
Expand description

A Way

Required Methods§

Source

fn nodes(&self) -> &[ObjId]

List of node ids in this way

Source

fn num_nodes(&self) -> usize

Number of nodes.

Source

fn node(&self, idx: usize) -> Option<ObjId>

Return node id at this position

Source

fn set_nodes(&mut self, nodes: impl IntoIterator<Item = impl Into<ObjId>>)

Provided Methods§

Source

fn nids(&self) -> &[ObjId]

Alias for Way::nodes().

Source

fn is_closed(&self) -> bool

A Way which begins and ends with the same Node is considered “closed”.

A closed way that also has an area=yes tag should be interpreted as an area.

This method only compares Node ID’s, and does no location based comparison.

Source

fn is_area(&self) -> bool

When is_area is true, the Way should be interpreted as a 2-D shape rather than a 1-D linestring. Uses OSM convention to detect “areas”.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§