pub struct ElevatorGroup { /* private fields */ }Expand description
Runtime elevator group: a set of lines sharing a dispatch strategy.
A group is the logical dispatch unit. It contains one or more
LineInfo entries, each representing a physical path with its
elevators and served stops.
The flat elevator_entities and stop_entities fields are derived
caches (union of all lines’ elevators/stops), rebuilt automatically
via rebuild_caches().
Implementations§
Source§impl ElevatorGroup
impl ElevatorGroup
Sourcepub fn new(id: GroupId, name: String, lines: Vec<LineInfo>) -> Self
pub fn new(id: GroupId, name: String, lines: Vec<LineInfo>) -> Self
Create a new group with the given lines. Caches are built automatically.
Sourcepub const fn lines_mut(&mut self) -> &mut Vec<LineInfo>
pub const fn lines_mut(&mut self) -> &mut Vec<LineInfo>
Mutable access to lines (call rebuild_caches() after mutating).
Sourcepub fn elevator_entities(&self) -> &[EntityId]
pub fn elevator_entities(&self) -> &[EntityId]
Elevator entities belonging to this group (derived from lines).
Sourcepub fn stop_entities(&self) -> &[EntityId]
pub fn stop_entities(&self) -> &[EntityId]
Stop entities served by this group (derived from lines, deduplicated).
Sourcepub fn rebuild_caches(&mut self)
pub fn rebuild_caches(&mut self)
Rebuild derived caches from lines. Call after mutating lines.
Trait Implementations§
Source§impl Clone for ElevatorGroup
impl Clone for ElevatorGroup
Source§fn clone(&self) -> ElevatorGroup
fn clone(&self) -> ElevatorGroup
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ElevatorGroup
impl Debug for ElevatorGroup
Source§impl<'de> Deserialize<'de> for ElevatorGroup
impl<'de> Deserialize<'de> for ElevatorGroup
Source§fn 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
Auto Trait Implementations§
impl Freeze for ElevatorGroup
impl RefUnwindSafe for ElevatorGroup
impl Send for ElevatorGroup
impl Sync for ElevatorGroup
impl Unpin for ElevatorGroup
impl UnsafeUnpin for ElevatorGroup
impl UnwindSafe for ElevatorGroup
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