Type Alias secrecy::SecretBox

source ·
pub type SecretBox<S> = Secret<Box<S>>;
Expand description

Box types containing a secret value

Aliased Type§

struct SecretBox<S> { /* private fields */ }

Implementations

source§

impl<S> Secret<S>
where S: Zeroize,

source

pub fn new(secret: S) -> Self

Take ownership of a secret value

Trait Implementations

source§

impl<S> Clone for Secret<S>
where S: CloneableSecret,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S> Debug for Secret<S>
where S: Zeroize + DebugSecret,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, T> Deserialize<'de> for Secret<T>

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<S> Drop for Secret<S>
where S: Zeroize,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<S> ExposeSecret<S> for Secret<S>
where S: Zeroize,

source§

fn expose_secret(&self) -> &S

Expose secret: this is the only method providing access to a secret.
source§

impl<S> From<S> for Secret<S>
where S: Zeroize,

source§

fn from(secret: S) -> Self

Converts to this type from the input type.
source§

impl<T> Serialize for Secret<T>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more