pub struct ModeController;Expand description
Controller that advances a traveller through a TripPlan.
Implementations§
Source§impl ModeController
impl ModeController
Sourcepub fn enter_current_leg(&self, ctx: &mut TravellerContext, plan: &TripPlan)
pub fn enter_current_leg(&self, ctx: &mut TravellerContext, plan: &TripPlan)
Transition the traveller to the start of their current leg. Call this whenever the previous leg signals completion.
Sourcepub fn complete_leg(&self, ctx: &mut TravellerContext, plan: &TripPlan)
pub fn complete_leg(&self, ctx: &mut TravellerContext, plan: &TripPlan)
Mark the current leg as complete and advance to the next one.
Sourcepub fn board_transit(
&self,
ctx: &mut TravellerContext,
vehicle: VehicleId,
alight_at: StopId,
)
pub fn board_transit( &self, ctx: &mut TravellerContext, vehicle: VehicleId, alight_at: StopId, )
Driven by transit code: a transit vehicle has arrived at the waiting stop, and the traveller boards it.
Sourcepub fn alight_transit(&self, ctx: &mut TravellerContext, plan: &TripPlan)
pub fn alight_transit(&self, ctx: &mut TravellerContext, plan: &TripPlan)
Driven by transit code: the alighting stop has been reached.
Trait Implementations§
Source§impl Clone for ModeController
impl Clone for ModeController
Source§fn clone(&self) -> ModeController
fn clone(&self) -> ModeController
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 ModeController
impl Debug for ModeController
Source§impl Default for ModeController
impl Default for ModeController
Source§fn default() -> ModeController
fn default() -> ModeController
Returns the “default value” for a type. Read more
impl Copy for ModeController
Auto Trait Implementations§
impl Freeze for ModeController
impl RefUnwindSafe for ModeController
impl Send for ModeController
impl Sync for ModeController
impl Unpin for ModeController
impl UnsafeUnpin for ModeController
impl UnwindSafe for ModeController
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