pub struct Junction<'a> { /* private fields */ }
Expand description
A Junction is a closed set of Segments which have physically coplanar road surfaces, in the sense that RoadPositions with the same h value (height above surface) in the domains of two Segments map to the same InertialPosition. The Segments need not be directly connected to one another in the network topology.
Junctions are grouped by RoadGeometry.
Implementations§
Source§impl<'a> Junction<'a>
impl<'a> Junction<'a>
Sourcepub fn id(&self) -> String
pub fn id(&self) -> String
Returns the id of the Junction. The id is a unique identifier for the Junction within the RoadGeometry.
§Returns
A String
containing the id of the Junction.
Sourcepub fn road_geometry(&self) -> RoadGeometry<'_>
pub fn road_geometry(&self) -> RoadGeometry<'_>
Returns the RoadGeometry to which this Junction belongs.
§Returns
A RoadGeometry
containing the RoadGeometry to which this Junction belongs.
Sourcepub fn num_segments(&self) -> i32
pub fn num_segments(&self) -> i32
Sourcepub fn segment(&self, index: i32) -> Result<Segment<'_>, MaliputError>
pub fn segment(&self, index: i32) -> Result<Segment<'_>, MaliputError>
Returns the segment at the given index
.
§Arguments
index
- The index of the segment to retrieve.
§Returns
A Result<Segment, MaliputError> containing the segment at the given index. If the index is out of bounds, an error is returned.