Skip to content

Slice

Module: core.slice
Source: core/slice.zn

Sliceable[T]

Slicing with a Range


pub fn slice(*self, range: Range) []T;

Range

Ranges variations:

  • lo..hi - { start: Some, end: Some }
  • lo..=hi - { start: Some, end: Some + 1 }
  • lo.. - { start: Some, end: None }
  • ..hi - { start: None, end: Some }
  • ..=hi - { start: None, end: Some + 1 }
  • .. - { start: None, end: None }

Fields:

pub start: Option[usize],
pub end: Option[usize],

Methods:

pub fn first(*const self) Option[usize];
pub fn last(*const self) Option[usize];

Interfaces:

  • core.ops : Copy
  • core.iter : Iterator