Struct sec::Secret [] [src]

pub struct Secret<T>(_);

Wraps a type T, preventing it from being accidentally revealed.

Methods

impl Secret<String>
[src]

[src]

Returns a str reference, wrapped in a secret

[src]

Return and reveal a str reference.

impl<T> Secret<T>
[src]

[src]

Creates a new secret

[src]

Create a secret immutable reference

[src]

Create a secret mutable reference

[src]

Reveal the held value by returning a reference

[src]

Reveal the held value by unwrapping

[src]

Reveals the held value by applying a function to it

Trait Implementations

impl<T> Debug for Secret<T>
[src]

[src]

Formats the value using the given formatter.

impl<T: Display> Display for Secret<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: Clone> Clone for Secret<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: PartialEq> PartialEq for Secret<T>
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<T: Hash> Hash for Secret<T>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

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

impl<T: Default> Default for Secret<T>
[src]

[src]

Returns the "default value" for a type. Read more

impl<T: Copy> Copy for Secret<T>
[src]

impl<T: Eq> Eq for Secret<T>
[src]

impl<T: Sync> Sync for Secret<T>
[src]

impl<T: Send> Send for Secret<T>
[src]

impl<T> From<T> for Secret<T>
[src]

[src]

Performs the conversion.