Trait OSMObj

Source
pub trait OSMObj: OSMObjBase {
    type Node: Node;
    type Way: Way;
    type Relation: Relation;

    // Required methods
    fn into_node(self) -> Option<Self::Node>;
    fn into_way(self) -> Option<Self::Way>;
    fn into_relation(self) -> Option<Self::Relation>;
    fn as_node(&self) -> Option<&Self::Node>;
    fn as_way(&self) -> Option<&Self::Way>;
    fn as_relation(&self) -> Option<&Self::Relation>;
    fn as_node_mut(&mut self) -> Option<&mut Self::Node>;
    fn as_way_mut(&mut self) -> Option<&mut Self::Way>;
    fn as_relation_mut(&mut self) -> Option<&mut Self::Relation>;

    // Provided methods
    fn is_node(&self) -> bool { ... }
    fn is_way(&self) -> bool { ... }
    fn is_relation(&self) -> bool { ... }
}
Expand description

Something which could be any one of the possible OSM objects

Required Associated Types§

Source

type Node: Node

The type of the Node type

Source

type Way: Way

The type of the Way type

Source

type Relation: Relation

The type of the Relation type

Required Methods§

Source

fn into_node(self) -> Option<Self::Node>

Source

fn into_way(self) -> Option<Self::Way>

Source

fn into_relation(self) -> Option<Self::Relation>

Source

fn as_node(&self) -> Option<&Self::Node>

Source

fn as_way(&self) -> Option<&Self::Way>

Source

fn as_relation(&self) -> Option<&Self::Relation>

Source

fn as_node_mut(&mut self) -> Option<&mut Self::Node>

Source

fn as_way_mut(&mut self) -> Option<&mut Self::Way>

Source

fn as_relation_mut(&mut self) -> Option<&mut Self::Relation>

Provided Methods§

Source

fn is_node(&self) -> bool

Source

fn is_way(&self) -> bool

Source

fn is_relation(&self) -> bool

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§