<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="API documentation for the Rust `Map` struct in crate `map_model`."><metaname="keywords"content="rust, rustlang, rust-lang, Map"><title>map_model::Map - Rust</title><linkrel="stylesheet"type="text/css"href="../normalize.css"><linkrel="stylesheet"type="text/css"href="../rustdoc.css"id="mainThemeStyle"><linkrel="stylesheet"type="text/css"href="../light.css"id="themeStyle"><linkrel="stylesheet"type="text/css"href="../dark.css"disabled><linkrel="stylesheet"type="text/css"href="../ayu.css"disabled><scriptsrc="../storage.js"></script><noscript><linkrel="stylesheet"href="../noscript.css"></noscript><linkrel="shortcut icon"href="../favicon.ico"><styletype="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><bodyclass="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu">☰</div><ahref='../map_model/index.html'><divclass='logo-container rust-logo'><imgsrc='../rust-logo.png'alt='logo'></div></a><pclass='location'>Struct Map</p><divclass="sidebar-elems"><divclass="block items"><aclass="sidebar-title"href="#fields">Fields</a><divclass="sidebar-links"><ahref="#structfield.areas">areas</a><ahref="#structfield.boundary_polygon">boundary_polygon</a><ahref="#structfield.bounds">bounds</a><ahref="#structfield.buildings">buildings</a><ahref="#structfield.bus_routes">bus_routes</a><ahref="#structfield.bus_stops">bus_stops</a><ahref="#structfield.config">config</a><ahref="#structfield.edits">edits</a><ahref="#structfield.gps_bounds">gps_bounds</a><ahref="#structfield.intersections">intersections</a><ahref="#structfield.lanes">lanes</a><ahref="#structfield.name">name</a><ahref="#structfield.parking_lots">parking_lots</a><ahref="#structfield.pathfinder">pathfinder</a><ahref="#structfield.pathfinder_dirty">pathfinder_dirty</a><ahref="#structfield.roads">roads</a><ahref="#structfield.stop_signs">stop_signs</a><ahref="#structfield.traffic_signals">traffic_signals</a><ahref="#structfield.turns">turns</a><ahref="#structfield.zones">zones</a></div><aclass="sidebar-title"href="#implementations">Methods</a><divclass="sidebar-links"><ahref="#method.all_areas">all_areas</a><ahref="#method.all_buildings">all_buildings</a><ahref="#method.all_bus_routes">all_bus_routes</a><ahref="#method.all_bus_stops">all_bus_stops</a><ahref="#method.all_incoming_borders">all_incoming_borders</a><ahref="#method.all_intersections">all_intersections</a><ahref="#method.all_lanes">all_lanes</a><ahref="#method.all_outgoing_borders">all_outgoing_borders</a><ahref="#method.all_parking_lots">all_parking_lots</a><ahref="#method.all_roads">all_roads</a><ahref="#method.all_turns">all_turns</a><ahref="#method.all_zones">all_zones</a><ahref="#method.apply_edits">apply_edits</a><ahref="#method.blank">blank</a><ahref="#method.building_to_road">building_to_road</a><ahref="#method.corrupt_err">corrupt_err</a><ahref="#method.create_from_raw">create_from_raw</a><ahref="#method.edit_road_cmd">edit_road_cmd</a><ahref="#method.find_b_by_osm_id">find_b_by_osm_id</a><ahref="#method.find_br">find_br</a><ahref="#method.find_driving_lane_near_building">find_driving_lane_near_building</a><ahref="#method.find_i_by_osm_id">find_i_by_osm_id</a><ahref="#method.find_r_by_osm_id">find_r_by_osm_id</a><ahref="#method.get_a">get_a</a><ahref="#method.get_b">get_b</a><ahref="#method.get_boundary_polygon">get_boundary_polygon</a><ahref="#method.get_bounds">get_bounds</a><ahref="#method.get_br">get_br</a><ahref="#method.get_bs">get_bs</a><ahref="#method.get_bus_route">get_bus_route</a><ahref="#method.get_city_name">get_city_name</a><ahref="#method.get_config">get_config</a><ahref="#method.get_edits">get_edits</a><ahref="#method.get_gps_bounds
</div><h4id='method.incremental_edit_traffic_signal'class="method"><code>pub fn <ahref='#method.incremental_edit_traffic_signal'class='fnname'>incremental_edit_traffic_signal</a>(&mut self, signal: <aclass="struct"href="../map_model/struct.ControlTrafficSignal.html"title="struct map_model::ControlTrafficSignal">ControlTrafficSignal</a>)</code><aclass='srclink'href='../src/map_model/edits/mod.rs.html#671-677'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Since the player is in the middle of editing, the signal may not be valid. Don't go through
</div><h4id='method.all_outgoing_borders'class="method"><code>pub fn <ahref='#method.all_outgoing_borders'class='fnname'>all_outgoing_borders</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><&<aclass="struct"href="../map_model/struct.Intersection.html"title="struct map_model::Intersection">Intersection</a>></code><aclass='srclink'href='../src/map_model/map.rs.html#465-473'title='goto source code'>[src]</a></h4><h4id='method.save'class="method"><code>pub fn <ahref='#method.save'class='fnname'>save</a>(&self)</code><aclass='srclink'href='../src/map_model/map.rs.html#475-480'title='goto source code'>[src]</a></h4><h4id='method.find_driving_lane_near_building'class="method"><code>pub fn <ahref='#method.find_driving_lane_near_building'class='fnname'>find_driving_lane_near_building</a>(&self, b: <aclass="struct"href="../map_model/struct.BuildingID.html"title="struct map_model::BuildingID">BuildingID</a>) -><aclass="struct"href="../map_model/struct.LaneID.html"title="struct map_model::LaneID">LaneID</a></code><aclass='srclink'href='../src/map_model/map.rs.html#487-537'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Cars trying to park near this building should head for the driving lane returned here, then
</div></div><h2id='trait-implementations'class='small-section-header'>Trait Implementations<ahref='#trait-implementations'class='anchor'></a></h2><divid='trait-implementations-list'><h3id='impl-Deserialize%3C%27de%3E'class='impl'><codeclass='in-band'>impl<'de><aclass="trait"href="https://docs.rs/serde/1.0.117/serde/de/trait.Deserialize.html"title="trait serde::de::Deserialize">Deserialize</a><'de> for <aclass="struct"href="../map_model/struct.Map.html"title="struct map_model::Map">Map</a></code><ahref='#impl-Deserialize%3C%27de%3E'class='anchor'></a><aclass='srclink'href='../src/map_model/lib.rs.html#80'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.deserialize'class="method hidden"><code>fn <ahref='https://docs.rs/serde/1.0.117/serde/de/trait.Deserialize.html#tymethod.deserialize'class='fnname'>deserialize</a><__D>(__deserializer: __D) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><Self, __D::<aclass="type"href="https://docs.rs/serde/1.0.117/serde/de/trait.Deserializer.html#associatedtype.Error"title="type serde::de::Deserializer::Error">Error</a>><spanclass="where fmt-newline">where<br> __D: <aclass="trait"href="https://docs.rs/serde/1.0.117/serde/de/trait.Deserializer.html"title="trait serde::de::Deserializer">Deserializer</a><'de>, </span></code><aclass='srclink'href='../src/map_model/lib.rs.html#80'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Deserialize this value from the given Serde deserializer. <ahref="https://docs.rs/serde/1.0.117/serde/de/trait.Deserialize.html#tymethod.deserialize">Read more</a></p>
</div></div><h3id='impl-Serialize'class='impl'><codeclass='in-band'>impl <aclass="trait"href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serialize.html"title="trait serde::ser::Serialize">Serialize</a> for <aclass="struct"href="../map_model/struct.Map.html"title="struct map_model::Map">Map</a></code><ahref='#impl-Serialize'class='anchor'></a><aclass='srclink'href='../src/map_model/lib.rs.html#80'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.serialize'class="method hidden"><code>fn <ahref='https://docs.rs/serde/1.0.117/serde/ser/trait.Serialize.html#tymethod.serialize'class='fnname'>serialize</a><__S>(&self, __serializer: __S) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><__S::<aclass="type"href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serializer.html#associatedtype.Ok"title="type serde::ser::Serializer::Ok">Ok</a>, __S::<aclass="type"href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serializer.html#associatedtype.Error"title="type serde::ser::Serializer::Error">Error</a>><spanclass="where fmt-newline">where<br> __S: <aclass="trait"href="https://docs.rs/serde/1.0.117/serde/ser/trait.Serializer.html"title="trait serde::ser::Serializer">Serializer</a>, </span></code><aclass='srclink'href='../src/map_model/lib.rs.html#80'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Serialize this value into the given Serde serializer. <ahref="https://docs.rs/serde/1.0.117/serde/ser/trait.Serialize.html#tymethod.serialize">Read more</a></p>
</div></div><h3id='impl-Same%3CT%3E'class='impl'><codeclass='in-band'>impl<T> Same<T> for T</code><ahref='#impl-Same%3CT%3E'class='anchor'></a></h3><divclass='impl-items'><h4id='associatedtype.Output'class="type"><code>type <ahref='#associatedtype.Output'class="type">Output</a> = T</code></h4><divclass='docblock'><p>Should always be <code>Self</code></p>
</div></div><h3id='impl-TryFrom%3CU%3E'class='impl'><codeclass='in-band'>impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>, </span></code><ahref='#impl-TryFrom%3CU%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#607-616'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='associatedtype.Error'class="type"><code>type <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error'class="type">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id='method.try_from'class="method hidden"><code>fn <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from'class='fnname'>try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#613-615'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id='impl-TryInto%3CU%3E'class='impl'><codeclass='in-band'>impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><ahref='#impl-TryInto%3CU%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#593-602'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='associatedtype.Error-1'class="type"><code>type <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error'class="type">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id='method.try_into'class="method hidden"><code>fn <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into'class='fnname'>try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#599-601'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>