# Struct variance::Invariant [−] [src]

    pub struct Invariant<T>(_);

A marker for forcing T to be considered invariant.

## Methods

### `impl<T> Invariant<T>`

#### `fn new() -> Self`

Create a new Invariant marker instance.

All instances of Invariant with the same T are equivalent.

## Trait Implementations

### `impl<T> Send for Invariant<T>`

### `impl<T> Sync for Invariant<T>`

### `impl<T> Default for Invariant<T>`

#### `fn default() -> Self`

### `impl<T> Copy for Invariant<T>`

### `impl<T> Clone for Invariant<T>`

#### `fn clone(&self) -> Self`

#### `fn clone_from(&mut self, source: &Self)`1.0.0

### `impl<T> Debug for Invariant<T>`

#### `fn fmt(&self, f: &mut Formatter) -> Result`

### `impl<T> PartialEq<Invariant<T>> for Invariant<T>`

#### `fn eq(&self, _: &Self) -> bool`

#### `fn ne(&self, _: &Self) -> bool`

### `impl<T> PartialOrd<Invariant<T>> for Invariant<T>`

#### `fn partial_cmp(&self, _: &Self) -> Option<Ordering>`

#### `fn lt(&self, _: &Self) -> bool`

#### `fn le(&self, _: &Self) -> bool`

#### `fn gt(&self, _: &Self) -> bool`

#### `fn ge(&self, _: &Self) -> bool`

### `impl<T> Eq for Invariant<T>`

### `impl<T> Ord for Invariant<T>`

#### `fn cmp(&self, _: &Self) -> Ordering`

### `impl<T> Hash for Invariant<T>`

#### `fn hash<H: Hasher>(&self, state: &mut H)`

#### `fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher` 1.3.0

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

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