[][src]Trait secrecy::SerializableSecret

pub trait SerializableSecret: Serialize { }
This is supported on feature="serde" only.

Marker trait for secret types which can be Serialize-d by serde.

When the serde feature of this crate is enabled and types are marked with this trait, they receive a Serialize impl for Secret<T>. (NOTE: all types which impl DeserializeOwned receive a Deserialize impl)

This is done deliberately to prevent accidental exfiltration of secrets via serde serialization.

If you are working with SecretString or SecretVec, not that by design these types do NOT impl this trait.

If you really want to have serde serialize those types, use the serialize_with attribute to specify a serializer that exposes the secret.

Implementors

Loading content...