pub struct RejectionContext {
pub attempted_weight: OrderedFloat<f64>,
pub current_load: OrderedFloat<f64>,
pub capacity: OrderedFloat<f64>,
}Expand description
Additional context for a rider rejection.
Provides the numeric details that led to the rejection decision.
Separated from RejectionReason to preserve Eq on the reason enum.
Fields§
§attempted_weight: OrderedFloat<f64>Weight the rider attempted to add.
current_load: OrderedFloat<f64>Current load on the elevator at rejection time.
capacity: OrderedFloat<f64>Maximum weight capacity of the elevator.
Trait Implementations§
Source§impl Clone for RejectionContext
impl Clone for RejectionContext
Source§fn clone(&self) -> RejectionContext
fn clone(&self) -> RejectionContext
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 RejectionContext
impl Debug for RejectionContext
Source§impl<'de> Deserialize<'de> for RejectionContext
impl<'de> Deserialize<'de> for RejectionContext
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
Source§impl Display for RejectionContext
impl Display for RejectionContext
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Compact summary for game feedback.
let ctx = RejectionContext {
attempted_weight: OrderedFloat(80.0),
current_load: OrderedFloat(750.0),
capacity: OrderedFloat(800.0),
};
assert_eq!(format!("{ctx}"), "over capacity by 30.0kg (750.0/800.0 + 80.0)");Source§impl PartialEq for RejectionContext
impl PartialEq for RejectionContext
Source§impl Serialize for RejectionContext
impl Serialize for RejectionContext
impl Copy for RejectionContext
impl Eq for RejectionContext
impl StructuralPartialEq for RejectionContext
Auto Trait Implementations§
impl Freeze for RejectionContext
impl RefUnwindSafe for RejectionContext
impl Send for RejectionContext
impl Sync for RejectionContext
impl Unpin for RejectionContext
impl UnsafeUnpin for RejectionContext
impl UnwindSafe for RejectionContext
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