Struct traffic_signal_data::Plan
source · [−]pub struct Plan {
pub start_time_seconds: usize,
pub stages: Vec<Stage>,
pub offset_seconds: usize,
}
Expand description
A plan describes how a traffic signal is configured during some period of time. Multiple plans allow a single intersection to behave differently in the middle of the night with low traffic, compared to the middle of rush hour.
Fields
start_time_seconds: usize
This plan takes effect at this local time, measured in seconds after midnight. The plan lasts until the next plan in the listed sequence starts, or ends at midnight if it’s the last plan.
stages: Vec<Stage>
The traffic signal repeatedly cycles through these stages. During each stage, only some turns are protected and permitted through the intersection.
offset_seconds: usize
Relative to a central clock, delay the first stage by this many seconds.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Plan
impl<'de> Deserialize<'de> for Plan
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
impl StructuralPartialEq for Plan
Auto Trait Implementations
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnwindSafe for Plan
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more