pub struct Segment<'a> { /* private fields */ }Expand description
A Segment represents a bundle of adjacent Lanes which share a continuously traversable road surface. Every LanePosition on a given Lane of a Segment has a corresponding LanePosition on each other Lane, all with the same height-above-surface h, that all map to the same GeoPoint in 3-space.
Segments are grouped by Junction.
Implementations§
Source§impl<'a> Segment<'a>
impl<'a> Segment<'a>
Sourcepub fn id(&self) -> String
pub fn id(&self) -> String
Returns the id of the Segment. The id is a unique identifier for the Segment within the RoadGeometry.
§Returns
A String containing the id of the Segment.
Sourcepub fn junction(&self) -> Result<Junction<'_>, MaliputError>
pub fn junction(&self) -> Result<Junction<'_>, MaliputError>
Returns the Junction to which this Segment belongs.
§Returns
An Result<Junction, MaliputError> containing the Junction to which this Segment belongs.
If the Segment does not belong to a Junction, an error is returned.
Sourcepub fn num_boundaries(&self) -> i32
pub fn num_boundaries(&self) -> i32
Returns the amount of boundaries in the segment.
Sourcepub fn boundaries(&self) -> Result<Vec<LaneBoundary<'_>>, MaliputError>
pub fn boundaries(&self) -> Result<Vec<LaneBoundary<'_>>, MaliputError>
Returns a Vec with all LaneBoundarys in the segment, which can be iterated.
§Returns
A Vec with all lane boundaries in the segment.
Sourcepub fn boundary(&self, index: i32) -> Result<LaneBoundary<'_>, MaliputError>
pub fn boundary(&self, index: i32) -> Result<LaneBoundary<'_>, MaliputError>
Returns the LaneBoundary that matches the index.
§Arguments
index- The index of the boundary. See LaneBoundary for more info about indexes.
§Returns
The LaneBoundary at the given index.