substring_replace

Trait FromOffset

source
pub trait FromOffset<T> {
    // Required method
    fn from_offset<U>(&self, relative_index: U) -> Option<&T>
       where U: ToOffset;
}
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§

source

fn from_offset<U>(&self, relative_index: U) -> Option<&T>
where U: ToOffset,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> FromOffset<T> for [T]

source§

fn from_offset<U>(&self, relative_index: U) -> Option<&T>
where U: ToOffset,

Implementors§