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§
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§
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.