Struct map_model::PermanentMapEdits
source · pub struct PermanentMapEdits {
pub map_name: MapName,
pub edits_name: String,
pub version: usize,
commands: Vec<PermanentEditCmd>,
pub proposal_description: Vec<String>,
pub proposal_link: Option<String>,
}
Expand description
MapEdits are converted to this before serializing. Referencing things like LaneID in a Map won’t work if the basemap is rebuilt from new OSM data, so instead we use stabler OSM IDs that’re less likely to change.
Fields§
§map_name: MapName
§edits_name: String
§version: usize
§commands: Vec<PermanentEditCmd>
§proposal_description: Vec<String>
Edits without these are player generated.
proposal_link: Option<String>
The link is optional even for proposals
Implementations§
source§impl PermanentMapEdits
impl PermanentMapEdits
sourcepub fn into_edits(self, map: &Map) -> Result<MapEdits>
pub fn into_edits(self, map: &Map) -> Result<MapEdits>
Transform permanent edits to MapEdits, looking up the map IDs by the hopefully stabler OSM IDs. Validate that the basemap hasn’t changed in important ways.
sourcepub fn into_edits_permissive(self, map: &Map) -> MapEdits
pub fn into_edits_permissive(self, map: &Map) -> MapEdits
Transform permanent edits to MapEdits, looking up the map IDs by the hopefully stabler OSM IDs. Strip out commands that’re broken, but log warnings.
Trait Implementations§
source§impl Clone for PermanentMapEdits
impl Clone for PermanentMapEdits
source§fn clone(&self) -> PermanentMapEdits
fn clone(&self) -> PermanentMapEdits
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'de> Deserialize<'de> for PermanentMapEdits
impl<'de> Deserialize<'de> for PermanentMapEdits
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PermanentMapEdits
impl RefUnwindSafe for PermanentMapEdits
impl Send for PermanentMapEdits
impl Sync for PermanentMapEdits
impl Unpin for PermanentMapEdits
impl UnwindSafe for PermanentMapEdits
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more