pub struct RiderBuilder<'a> { /* private fields */ }Expand description
Fluent builder for spawning riders with optional configuration.
Created via Simulation::build_rider or Simulation::build_rider_by_stop_id.
use elevator_core::prelude::*;
let mut sim = SimulationBuilder::new().build().unwrap();
let rider = sim.build_rider_by_stop_id(StopId(0), StopId(1))
.unwrap()
.weight(80.0)
.spawn()
.unwrap();Implementations§
Source§impl RiderBuilder<'_>
impl RiderBuilder<'_>
Sourcepub const fn group(self, group: GroupId) -> Self
pub const fn group(self, group: GroupId) -> Self
Set the dispatch group explicitly, skipping auto-detection.
Sourcepub const fn patience(self, max_wait_ticks: u64) -> Self
pub const fn patience(self, max_wait_ticks: u64) -> Self
Set maximum wait ticks before the rider abandons.
Sourcepub const fn preferences(self, prefs: Preferences) -> Self
pub const fn preferences(self, prefs: Preferences) -> Self
Set boarding preferences.
Sourcepub fn access_control(self, ac: AccessControl) -> Self
pub fn access_control(self, ac: AccessControl) -> Self
Set per-rider access control (allowed stops).
Sourcepub fn spawn(self) -> Result<EntityId, SimError>
pub fn spawn(self) -> Result<EntityId, SimError>
Spawn the rider with the configured options.
§Errors
Returns SimError::NoRoute if no group serves both stops (when auto-detecting).
Returns SimError::AmbiguousRoute if multiple groups serve both stops (when auto-detecting).
Returns SimError::GroupNotFound if an explicit group does not exist.
Auto Trait Implementations§
impl<'a> Freeze for RiderBuilder<'a>
impl<'a> !RefUnwindSafe for RiderBuilder<'a>
impl<'a> Send for RiderBuilder<'a>
impl<'a> Sync for RiderBuilder<'a>
impl<'a> Unpin for RiderBuilder<'a>
impl<'a> UnsafeUnpin for RiderBuilder<'a>
impl<'a> !UnwindSafe for RiderBuilder<'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