pub enum GetDisjointMutError {
IndexOutOfBounds,
OverlappingIndices,
}
Expand description
The error type returned by get_disjoint_mut
.
It indicates one of two possible errors:
- An index is out-of-bounds.
- The same index appeared multiple times in the array (or different but overlapping indices when ranges are provided).
§Examples
use std::slice::GetDisjointMutError;
let v = &mut [1, 2, 3];
assert_eq!(v.get_disjoint_mut([0, 999]), Err(GetDisjointMutError::IndexOutOfBounds));
assert_eq!(v.get_disjoint_mut([1, 1]), Err(GetDisjointMutError::OverlappingIndices));
Variants§
IndexOutOfBounds
An index provided was out-of-bounds for the slice.
OverlappingIndices
Two indices provided were overlapping.
Trait Implementations§
1.86.0 · Source§impl Clone for GetDisjointMutError
impl Clone for GetDisjointMutError
Source§fn clone(&self) -> GetDisjointMutError
fn clone(&self) -> GetDisjointMutError
Returns a copy 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 more1.86.0 · Source§impl Debug for GetDisjointMutError
impl Debug for GetDisjointMutError
1.86.0 · Source§impl Display for GetDisjointMutError
impl Display for GetDisjointMutError
1.86.0 · Source§impl Error for GetDisjointMutError
impl Error for GetDisjointMutError
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()
1.86.0 · Source§impl PartialEq for GetDisjointMutError
impl PartialEq for GetDisjointMutError
impl Eq for GetDisjointMutError
impl StructuralPartialEq for GetDisjointMutError
Auto Trait Implementations§
impl Freeze for GetDisjointMutError
impl RefUnwindSafe for GetDisjointMutError
impl Send for GetDisjointMutError
impl Sync for GetDisjointMutError
impl Unpin for GetDisjointMutError
impl UnwindSafe for GetDisjointMutError
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