# Trait ocl::traits::MemLen [−] [src]

    pub trait MemLen {
        fn to_len(&self) -> usize;
        fn to_len_padded(&self, incr: usize) -> usize;
        fn to_lens(&self) -> [usize; 3];
    }

Types which have properties allowing them to be used to define the size of a volume of memory.

Units are expressed in `bytes / size_of(T)` just like `Vec::len()`.

## Required Methods

### `fn to_len(&self) -> usize`

Returns the exact number of elements of a volume of memory (equivalent to `Vec::len()`).

### `fn to_len_padded(&self, incr: usize) -> usize`

Returns the length of a volume of memory padded to the next multiple of `incr`.

### `fn to_lens(&self) -> [usize; 3]`

Returns the exact lengths of each dimension of a volume of memory.

## Implementations on Foreign Types

### `impl<'a, D> MemLen for &'a D where
D: MemLen,`
[src]

#### `fn to_len(&self) -> usize`
[src]

#### `fn to_len_padded(&self, incr: usize) -> usize`
[src]

#### `fn to_lens(&self) -> [usize; 3]`
[src]

### `impl<D> MemLen for (D,) where
D: Num + ToPrimitive + Debug + Copy,`
[src]

#### `fn to_len(&self) -> usize`
[src]

#### `fn to_len_padded(&self, incr: usize) -> usize`
[src]

#### `fn to_lens(&self) -> [usize; 3]`
[src]

### `impl<D> MemLen for [D; 1] where
D: Num + ToPrimitive + Debug + Copy,`
[src]

#### `fn to_len(&self) -> usize`
[src]

#### `fn to_len_padded(&self, incr: usize) -> usize`
[src]

#### `fn to_lens(&self) -> [usize; 3]`
[src]

### `impl<D> MemLen for (D, D) where
D: Num + ToPrimitive + Debug + Copy,`
[src]

#### `fn to_len(&self) -> usize`
[src]

#### `fn to_len_padded(&self, incr: usize) -> usize`
[src]

#### `fn to_lens(&self) -> [usize; 3]`
[src]

### `impl<D> MemLen for [D; 2] where
D: Num + ToPrimitive + Debug + Copy,`
[src]

#### `fn to_len(&self) -> usize`
[src]

#### `fn to_len_padded(&self, incr: usize) -> usize`
[src]

#### `fn to_lens(&self) -> [usize; 3]`
[src]

### `impl<'a, D> MemLen for (D, D, D) where
D: Num + ToPrimitive + Debug + Copy,`
[src]

#### `fn to_len(&self) -> usize`
[src]

#### `fn to_len_padded(&self, incr: usize) -> usize`
[src]

#### `fn to_lens(&self) -> [usize; 3]`
[src]

### `impl<'a, D> MemLen for [D; 3] where
D: Num + ToPrimitive + Debug + Copy,`
[src]

#### `fn to_len(&self) -> usize`
[src]

#### `fn to_len_padded(&self, incr: usize) -> usize`
[src]

#### `fn to_lens(&self) -> [usize; 3]`
[src]

## Implementors

- [src]
  `impl MemLen for ProQue`
- [src]
  `impl MemLen for SpatialDims`

# 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`)