# [−][src]Trait nalgebra::base::SliceRange

    pub trait SliceRange<D: Dim> {
        type Size: Dim;
        fn begin(&self, shape: D) -> usize;
        fn end(&self, shape: D) -> usize;
        fn size(&self, shape: D) -> Self::Size;
    }

A range with a size that may be known at compile-time.

This may be:

- A single `usize` index, e.g., `4`
- A left-open range `std::ops::RangeTo`, e.g., `.. 4`
- A right-open range `std::ops::RangeFrom`, e.g., `4 ..`
- A full range `std::ops::RangeFull`, e.g., `..`

## Associated Types

### `type Size: Dim`

Type of the range size. May be a type-level integer.

Loading content...

## Required methods

### `fn begin(&self, shape: D) -> usize`

The start index of the range.

### `fn end(&self, shape: D) -> usize`

The index immediately after the last index inside of the range.

### `fn size(&self, shape: D) -> Self::Size`

The number of elements of the range, i.e., `self.end - self.begin`.

Loading content...

## Implementations on Foreign Types

### `impl<D: Dim> SliceRange<D> for usize`[src]

#### `type Size = U1`

#### `fn begin(&self, _: D) -> usize`[src]

#### `fn end(&self, _: D) -> usize`[src]

#### `fn size(&self, _: D) -> Self::Size`[src]

### `impl<D: Dim> SliceRange<D> for Range<usize>`[src]

#### `type Size = Dynamic`

#### `fn begin(&self, _: D) -> usize`[src]

#### `fn end(&self, _: D) -> usize`[src]

#### `fn size(&self, _: D) -> Self::Size`[src]

### `impl<D: Dim> SliceRange<D> for RangeFrom<usize>`[src]

#### `type Size = Dynamic`

#### `fn begin(&self, _: D) -> usize`[src]

#### `fn end(&self, dim: D) -> usize`[src]

#### `fn size(&self, dim: D) -> Self::Size`[src]

### `impl<D: Dim> SliceRange<D> for RangeTo<usize>`[src]

#### `type Size = Dynamic`

#### `fn begin(&self, _: D) -> usize`[src]

#### `fn end(&self, _: D) -> usize`[src]

#### `fn size(&self, _: D) -> Self::Size`[src]

### `impl<D: Dim> SliceRange<D> for RangeFull`[src]

#### `type Size = D`

#### `fn begin(&self, _: D) -> usize`[src]

#### `fn end(&self, dim: D) -> usize`[src]

#### `fn size(&self, dim: D) -> Self::Size`[src]

Loading content...

## Implementors

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)