core::mem::Discriminant - Rust
Description: API documentation for the Rust `Discriminant` struct in crate `core`.
Keywords: rust, rustlang, rust-lang, Discriminant

# 1.21.0[−][src]Struct core::mem::Discriminant

    pub struct Discriminant<T>(_);

Opaque type representing the discriminant of an enum.

See the `discriminant` function in this module for more information.

## Trait Implementations

### `impl<T> Clone for Discriminant<T>`[src]

#### `fn clone(&self) -> Self`[src]

Returns a copy of the value. Read more

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

Performs copy-assignment from `source`. Read more

### `impl<T> Copy for Discriminant<T>`[src]

### `impl<T> Debug for Discriminant<T>`[src]

#### `fn fmt(&self, fmt: &mut Formatter<'_>) -> Result`[src]

Formats the value using the given formatter. Read more

### `impl<T> Eq for Discriminant<T>`[src]

### `impl<T> Hash for Discriminant<T>`[src]

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

Feeds this value into the given `Hasher`. Read more

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

Feeds a slice of this type into the given `Hasher`. Read more

### `impl<T> PartialEq<Discriminant<T>> for Discriminant<T>`[src]

#### `fn eq(&self, rhs: &Self) -> bool`[src]

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `#[must_use]fn ne(&self, other: &Rhs) -> bool`1.0.0[src]

This method tests for `!=`.

## Auto Trait Implementations

### `impl<T> Send for Discriminant<T> where
<T as DiscriminantKind>::Discriminant: Send,`

### `impl<T> Sync for Discriminant<T> where
<T as DiscriminantKind>::Discriminant: Sync,`

### `impl<T> Unpin for Discriminant<T> where
<T as DiscriminantKind>::Discriminant: Unpin,`

## Blanket Implementations

### `impl<T> Any for T where
T: 'static + ?Sized,` [src]

#### `fn type_id(&Self) -> TypeId`[src]

Gets the `TypeId` of `self`. Read more

### `impl<T> Borrow<T> for T where
T: ?Sized,` [src]

#### `fn borrow(&Self) -> &T`[src]

Immutably borrows from an owned value. Read more

### `impl<T> BorrowMut<T> for T where
T: ?Sized,` [src]

#### `fn borrow_mut(&mut Self) -> &mut T`[src]

Mutably borrows from an owned value. Read more

### `impl<T> From<T> for T`[src]

#### `fn from(T) -> T`[src]

Performs the conversion.

### `impl<T, U> Into<U> for T where
U: From<T>,` [src]

#### `fn into(Self) -> U`[src]

Performs the conversion.

### `impl<T, U> TryFrom<U> for T where
U: Into<T>,` [src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

#### `fn try_from(U) -> Result<T, <T as TryFrom<U>>::Error>`[src]

Performs the conversion.

### `impl<T, U> TryInto<U> for T where
U: TryFrom<T>,` [src]

#### `type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.

#### `fn try_into(Self) -> Result<U, <U as TryFrom<T>>::Error>`[src]

Performs the conversion.