pub enum InvalidFrameReason {
NullFrame,
Negative,
MustBeNonNegative,
NotInPast {
current_frame: Frame,
},
OutsidePredictionWindow {
current_frame: Frame,
max_prediction: usize,
},
WrongSavedFrame {
saved_frame: Frame,
},
NotConfirmed {
confirmed_frame: Frame,
},
NullOrNegative,
MissingState,
Custom(&'static str),
}Expand description
Represents why a frame was invalid.
Using an enum instead of String allows for zero-allocation error construction on hot paths while still providing detailed error messages.
Variants§
NullFrame
Frame is NULL_FRAME (-1).
Negative
Frame is negative (other than NULL_FRAME).
MustBeNonNegative
Frame must be non-negative.
NotInPast
Frame is not in the past (must load a frame before current).
OutsidePredictionWindow
Frame is outside the prediction window.
WrongSavedFrame
The saved state for this frame has the wrong frame number.
NotConfirmed
Frame is not confirmed yet.
NullOrNegative
Frame is NULL or negative (general validation).
MissingState
No saved state exists for this frame.
Returned when attempting to load a game state that was never saved.
This typically indicates a programming error — LoadGameState requests
should only be issued for frames that were previously saved via
SaveGameState.
Custom(&'static str)
Custom reason (fallback for API compatibility).
Trait Implementations§
Source§impl Clone for InvalidFrameReason
impl Clone for InvalidFrameReason
Source§fn clone(&self) -> InvalidFrameReason
fn clone(&self) -> InvalidFrameReason
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more