pub struct TrafficLightBook<'a> { /* private fields */ }Expand description
Interface for accessing the TrafficLight in the super::RoadNetwork
Implementations§
Source§impl<'a> TrafficLightBook<'a>
impl<'a> TrafficLightBook<'a>
Sourcepub fn traffic_lights(&self) -> Vec<TrafficLight<'_>>
pub fn traffic_lights(&self) -> Vec<TrafficLight<'_>>
Sourcepub fn get_traffic_light(&self, id: &String) -> Option<TrafficLight<'_>>
pub fn get_traffic_light(&self, id: &String) -> Option<TrafficLight<'_>>
Gets a TrafficLight by its id.
§Arguments
id- The id of the TrafficLight.
§Returns
The TrafficLight with the given id. If no TrafficLight is found with the given id, return None.
Sourcepub fn find_by_lane(&self, lane_id: &String) -> Vec<TrafficLight<'_>>
pub fn find_by_lane(&self, lane_id: &String) -> Vec<TrafficLight<'_>>
Gets all TrafficLights whose related_lanes() includes the given lane ID.
§Arguments
lane_id- The lane ID to look up.
§Returns
A vector of TrafficLights associated with the given lane. Returns an empty vector if no traffic lights are associated with the lane.
Auto Trait Implementations§
impl<'a> Freeze for TrafficLightBook<'a>
impl<'a> RefUnwindSafe for TrafficLightBook<'a>
impl<'a> !Send for TrafficLightBook<'a>
impl<'a> !Sync for TrafficLightBook<'a>
impl<'a> Unpin for TrafficLightBook<'a>
impl<'a> UnsafeUnpin for TrafficLightBook<'a>
impl<'a> UnwindSafe for TrafficLightBook<'a>
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