pub trait FromOffset<T>where
T: Sized,{
// Required method
fn from_offset<U: ToOffset>(&self, relative_index: U) -> Option<&T>;
}Expand description
Provide from_offset convenience method that allows negative offsets from the end of an array/vector and never extends beyond the array/vector bounds It returns Option<&T> in keeping with the default get() method and because the array or vector may still be empty
Required Methods§
fn from_offset<U: ToOffset>(&self, relative_index: U) -> Option<&T>
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.