Struct map_model::PermanentMapEdits
source · [−]pub struct PermanentMapEdits {
pub map_name: MapName,
pub edits_name: String,
pub version: usize,
commands: Vec<PermanentEditCmd>,
merge_zones: bool,
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>
merge_zones: bool
If false, adjacent roads with the same AccessRestrictions will not be merged into the same Zone; every Road will be its own Zone. This is used to experiment with a per-road cap. Note this is a map-wide setting.
proposal_description: Vec<String>
Edits without these are player generated.
proposal_link: Option<String>
The link is optional even for proposals
Implementations
sourceimpl 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
sourceimpl Clone for PermanentMapEdits
impl Clone for PermanentMapEdits
sourcefn clone(&self) -> PermanentMapEdits
fn clone(&self) -> PermanentMapEdits
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'de> Deserialize<'de> for PermanentMapEdits
impl<'de> Deserialize<'de> for PermanentMapEdits
sourcefn 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
sourceimpl Serialize for PermanentMapEdits
impl Serialize for PermanentMapEdits
Auto Trait Implementations
impl RefUnwindSafe for PermanentMapEdits
impl Send for PermanentMapEdits
impl Sync for PermanentMapEdits
impl Unpin for PermanentMapEdits
impl UnwindSafe for PermanentMapEdits
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more