pub enum ActionSnapshotError {
TooManyHandles {
count: usize,
},
OutputTooSmall {
required: usize,
available: usize,
},
InvalidHandle {
index: usize,
},
}Expand description
A rejected atomic group read. Neither input nor caller output is changed.
Checks run in this order: handle count, output capacity, then handles in
caller order. The count includes duplicates and is bounded by MAX_ACTIONS.
This separate error leaves the legacy InputError variants unchanged.
use ferravex_play::input::{Action, ActionMap, ActionSnapshotError};
let mut input = ActionMap::default();
let id = input.action(vec![]);
let handle = input.handle_from_id(id).unwrap();
let mut other = ActionMap::default();
let id = other.action(vec![]);
let foreign = other.handle_from_id(id).unwrap();
let sentinel = Action { value: 0.5, ..Action::default() };
let mut output = [sentinel; 2];
assert_eq!(input.consume_tick_handles_into(&[handle, foreign], &mut output),
Err(ActionSnapshotError::InvalidHandle { index: 1 }));
assert_eq!(output, [sentinel; 2]);Variants§
TooManyHandles
More than MAX_ACTIONS handles were requested.
OutputTooSmall
The output cannot hold one snapshot per requested handle.
InvalidHandle
The handle at this zero-based position is foreign, stale or out of bounds.
Trait Implementations§
Source§impl Clone for ActionSnapshotError
impl Clone for ActionSnapshotError
Source§fn clone(&self) -> ActionSnapshotError
fn clone(&self) -> ActionSnapshotError
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 ActionSnapshotError
impl Debug for ActionSnapshotError
Source§impl Display for ActionSnapshotError
impl Display for ActionSnapshotError
Source§impl Error for ActionSnapshotError
impl Error for ActionSnapshotError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for ActionSnapshotError
impl PartialEq for ActionSnapshotError
impl Copy for ActionSnapshotError
impl Eq for ActionSnapshotError
impl StructuralPartialEq for ActionSnapshotError
Auto Trait Implementations§
impl Freeze for ActionSnapshotError
impl RefUnwindSafe for ActionSnapshotError
impl Send for ActionSnapshotError
impl Sync for ActionSnapshotError
impl Unpin for ActionSnapshotError
impl UnwindSafe for ActionSnapshotError
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