Struct traffic_signal_data::Plan[][src]

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.