[−][src]Trait higher_order_functions::Section
Operator to retrieve a fixed-size section of an array-like structure.
Examples
Extracting elements from an array:
use higher_order_functions::Section; let a: [u32; 8] = [1, 2, 3, 4, 5, 6, 7, 8]; let arr: [u32; 4] = a.section(3); // Extracts 4 elements starting at a[3] assert_eq!(arr, [4, 5, 6, 7]);
Required methods
fn section(&self, offset: TOffset) -> TOut
Get a section of type TOut
starting at offset offset
.
Panics
Implementors may panic if offset
results in the section going out of bounds.