pub trait TwoSidedIndex<T>: Sized + Debug {
type Output: ?Sized;
// Required methods
unsafe fn get_unchecked(self, target: &TwoSidedVec<T>) -> &Self::Output;
unsafe fn get_unchecked_mut(
self,
target: &mut TwoSidedVec<T>,
) -> &mut Self::Output;
fn check(&self, target: &TwoSidedVec<T>) -> bool;
// Provided methods
fn get(self, target: &TwoSidedVec<T>) -> Option<&Self::Output> { ... }
fn get_mut(self, target: &mut TwoSidedVec<T>) -> Option<&mut Self::Output> { ... }
fn index(self, target: &TwoSidedVec<T>) -> &Self::Output { ... }
fn index_mut(self, target: &mut TwoSidedVec<T>) -> &mut Self::Output { ... }
fn invalid(self) -> ! { ... }
}Required Associated Types§
Required Methods§
Sourceunsafe fn get_unchecked(self, target: &TwoSidedVec<T>) -> &Self::Output
unsafe fn get_unchecked(self, target: &TwoSidedVec<T>) -> &Self::Output
Use this as an index against the specified vec
§Safety
Undefined behavior if the index is out of bounds
Sourceunsafe fn get_unchecked_mut(
self,
target: &mut TwoSidedVec<T>,
) -> &mut Self::Output
unsafe fn get_unchecked_mut( self, target: &mut TwoSidedVec<T>, ) -> &mut Self::Output
Use this as an index against the specified vec
§Safety
Undefined behavior if the index is out of bounds
fn check(&self, target: &TwoSidedVec<T>) -> bool
Provided Methods§
fn get(self, target: &TwoSidedVec<T>) -> Option<&Self::Output>
fn get_mut(self, target: &mut TwoSidedVec<T>) -> Option<&mut Self::Output>
fn index(self, target: &TwoSidedVec<T>) -> &Self::Output
fn index_mut(self, target: &mut TwoSidedVec<T>) -> &mut Self::Output
fn invalid(self) -> !
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.