Enum PoolAccessError
pub enum PoolAccessError {
InvalidHandle {
position: usize,
},
DuplicateHandle {
first: usize,
second: usize,
},
}Expand description
A failed selection for Pool::get2_mut or Pool::get_many_mut.
Positions are zero-based in the caller’s selection, not pool slot indices. All handles are checked for liveness in caller order first. Only if every handle is live are duplicates checked, reporting the earliest repeated position and its first occurrence. Failure leaves the pool unchanged. Pool identity is not checked; handles must belong to the originating pool.
use ferravex_engine::pool::{Pool, PoolAccessError};
let mut pool = Pool::new(1);
let actor = pool.insert(10).unwrap();
assert_eq!(pool.get2_mut(actor, actor),
Err(PoolAccessError::DuplicateHandle { first: 0, second: 1 }));
pool.clear();
assert_eq!(pool.get_many_mut([actor]),
Err(PoolAccessError::InvalidHandle { position: 0 }));Variants§
InvalidHandle
The handle is out of range, vacant, retired, or has a stale generation.
DuplicateHandle
Two live handles select the same slot.
Trait Implementations§
§impl Clone for PoolAccessError
impl Clone for PoolAccessError
§fn clone(&self) -> PoolAccessError
fn clone(&self) -> PoolAccessError
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 more§impl Debug for PoolAccessError
impl Debug for PoolAccessError
§impl Display for PoolAccessError
impl Display for PoolAccessError
§impl Error for PoolAccessError
impl Error for PoolAccessError
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()
§impl PartialEq for PoolAccessError
impl PartialEq for PoolAccessError
impl Copy for PoolAccessError
impl Eq for PoolAccessError
impl StructuralPartialEq for PoolAccessError
Auto Trait Implementations§
impl Freeze for PoolAccessError
impl RefUnwindSafe for PoolAccessError
impl Send for PoolAccessError
impl Sync for PoolAccessError
impl Unpin for PoolAccessError
impl UnwindSafe for PoolAccessError
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