pub fn from_segments(
        segment_list: &Vec<Segment>,
        name: Option<String>,
        forbidden_to_bikes: bool,
        forbidden_to_pedestrians: bool,
        layer: Option<i8>
    ) -> Road {
        let mut point_list: Vec<Point> = Vec::new();
        for segment in segment_list {
            point_list.push(segment.a);
        }
        point_list.push(segment_list[&segment_list.len()-1].b);
        Road{
            points: point_list,
            name: name,
            forbidden_to_bikes: forbidden_to_bikes,
            forbidden_to_pedestrians:forbidden_to_pedestrians,
            layer: layer
        }
    }
/// Create a road from a vector of `Segment`s (legacy format)
Create a road from a vector of `Segment`s (legacy format)
Create a road from a vector of ` Segment ` s ( legacy format )
pub fn from_segments(
        segment_list: &Vec<Segment>,
        name: Option<String>,
        forbidden_to_bikes: bool,
        forbidden_to_pedestrians: bool,
        layer: Option<i8>
    ) -> Road {
        let mut point_list: Vec<Point> = Vec::new();
        for segment in segment_list {
            point_list.push(segment.a);
        }
        point_list.push(segment_list[&segment_list.len()-1].b);
        Road{
            points: point_list,
            name: name,
            forbidden_to_bikes: forbidden_to_bikes,
            forbidden_to_pedestrians:forbidden_to_pedestrians,
            layer: layer
        }
    }
pub fn from_segments ( segment_list : & Vec < Segment > , name : Option < String > , forbidden_to_bikes : bool , forbidden_to_pedestrians : bool , layer : Option < i8 > ) -> Road { let mut point_list : Vec < Point > = Vec :: new ( ) ; for segment in segment_list { point_list . push ( segment . a ) ; } point_list . push ( segment_list [ & segment_list . len ( ) - 1 ] . b ) ; Road { points : point_list , name : name , forbidden_to_bikes : forbidden_to_bikes , forbidden_to_pedestrians : forbidden_to_pedestrians , layer : layer } }
Create a road from a vector of `Segment`s (legacy format)
Create a road from a vector of ` Segment ` s ( legacy format )
segment_list
&Vec<Segment>
name
Option<String>
forbidden_to_bikes
bool
forbidden_to_pedestrians
bool
layer
Option<i8>
segment_list
&Vec<Segment>
name
Option<String>
forbidden_to_bikes
bool
forbidden_to_pedestrians
bool
layer
Option<i8>