[][src]Module smart_access::core_impls

Implementation of At for core datatypes.

The following traits are implemented:

  • At<usize, View=T> for [T]: simple indexing
  • At<range, View=[T]> for [T]: subslice (of fixed size)
  • At<(), View=T> for Option<T>: the only meaningful sort of access
  • At<(), View=R> for Result<R,E>: access to the Ok value

All implementations never panic: None is returned instead if the index doesn't make any sense. If you want panicking behaviour simply add .unwrap() to your access.