# openssl::hash::MessageDigest - Rust
API documentation for the Rust `MessageDigest` struct in crate `openssl`.
Keywords: rust, rustlang, rust-lang, MessageDigest

# Struct openssl::hash::MessageDigest [−] [src]

    pub struct MessageDigest(_);

## Implementations

### `impl MessageDigest` [src]

#### `pub unsafe fn from_ptr(x: *const EVP_MD) -> Self` [src]

Creates a `MessageDigest` from a raw OpenSSL pointer.

# Safety

The caller must ensure the pointer is valid.

#### `pub fn from_nid(type_: Nid) -> Option<MessageDigest>` [src]

Returns the `MessageDigest` corresponding to an `Nid`.

This corresponds to `EVP_get_digestbynid`.

#### `pub fn from_name(name: &str) -> Option<MessageDigest>` [src]

Returns the `MessageDigest` corresponding to an algorithm name.

This corresponds to `EVP_get_digestbyname`.

#### `pub fn null() -> MessageDigest` [src]

#### `pub fn md5() -> MessageDigest` [src]

#### `pub fn sha1() -> MessageDigest` [src]

#### `pub fn sha224() -> MessageDigest` [src]

#### `pub fn sha256() -> MessageDigest` [src]

#### `pub fn sha384() -> MessageDigest` [src]

#### `pub fn sha512() -> MessageDigest` [src]

#### `pub fn sha3_224() -> MessageDigest` [src]

#### `pub fn sha3_256() -> MessageDigest` [src]

#### `pub fn sha3_384() -> MessageDigest` [src]

#### `pub fn sha3_512() -> MessageDigest` [src]

#### `pub fn shake_128() -> MessageDigest` [src]

#### `pub fn shake_256() -> MessageDigest` [src]

#### `pub fn ripemd160() -> MessageDigest` [src]

#### `pub fn sm3() -> MessageDigest` [src]

#### `pub fn as_ptr(&self) -> *const EVP_MD` [src]

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

The size of the digest in bytes.

#### `pub fn type_(&self) -> Nid` [src]

The name of the digest.

## Trait Implementations

### `impl Clone for MessageDigest` [src]

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

Returns a copy of the value. Read more

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

Performs copy-assignment from `source`. Read more

### `impl Copy for MessageDigest` [src]

### `impl Eq for MessageDigest` [src]

### `impl PartialEq<MessageDigest> for MessageDigest` [src]

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

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

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

This method tests for `!=`.

### `impl Send for MessageDigest` [src]

### `impl StructuralEq for MessageDigest` [src]

### `impl StructuralPartialEq for MessageDigest` [src]

### `impl Sync for MessageDigest` [src]

## Auto Trait Implementations

### `impl RefUnwindSafe for MessageDigest` [src]

### `impl Unpin for MessageDigest` [src]

### `impl UnwindSafe for MessageDigest` [src]

## Blanket Implementations

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

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

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

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

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

Immutably borrows from an owned value. Read more

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

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

Mutably borrows from an owned value. Read more

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

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

Performs the conversion.

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

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

Performs the conversion.

### `impl<T> ToOwned for T where
T: Clone,` [src]

#### `type Owned = T`

The resulting type after obtaining ownership.

#### `pub fn to_owned(&self) -> T` [src]

Creates owned data from borrowed data, usually by cloning. Read more

#### `pub fn clone_into(&self, target: &mut T)` [src]

🔬 This is a nightly-only experimental API. (`toowned_clone_into`)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

#### `pub fn try_from(value: 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.

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

Performs the conversion.